Spring Boot Microservices Redirection

I made one authentication-service to handle profile management and authentication (login and registering new user) and another home-service for showing the web pages related to home page and other pages etc. For now i just want to go to the authentication-service once i go to localhost:8079 (port number of api gateway). How to do that? I'm using consul instead of eureka. Dependencies installed in authentication-service - spring-cloud-starter-consul-discovery, spring-cloud-starter-openfeign Dependencies installed in home-service - spring-cloud-starter-config, spring-cloud-starter-consul-discovery, spring-cloud-starter-openfeign Other dependencies are security, thymeleaf, jpa, mysql, jjwt I have used enable discovery client annotation in both services main application file. I run consul.exe using cmd and it shows both the services. I also made one gateway with enable discovery client annotation.
3 Replies
JavaBot
JavaBot5mo ago
This post has been reserved for your question.
Hey @All Might! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here. 💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Yang
Yang5mo ago
if you are using springboot, you can use Springboot Controller classes to redirect it to any path, for example
http://localhost:8079 > http://localhost:8079/auth
http://localhost:8079 > http://localhost:8079/auth
If you are thinking of microservices as in multiple springboot instances which different path services, that is much much harder. Usually they have unique paths. for example api.mywebsite, auth.mywebsite, admin.mywebsite. it depends on the architecture but it's usually seperate machines. that means seperate IP Address as well. I highly recommend doing some more research about this. If you don't want to complicate yourself, best to make it just one app instead of multiple
JavaBot
JavaBot5mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?