Let's say I have a service named "FooService" running in a docker container and a second service named "BarService" running in a second docker container. Both services register with Eureka (running in another docker container). Is it possible to have the same application name for both services? E.g. http://localhost/myservice/foo should call the FooService and http://localhost/myservice/bar should call the BarService. Development environment is Spring Boot and the services are implemented as Spring RestControllers. Just put "spring.application.name=myservice" in both bootstrap.properties files and then put @RequestMapping("${spring.application.name}") in the RestController will not work, of course. But is it somehow possible to register the services with a unique identifier and still call them with a common URL path?
Asked
Active
Viewed 354 times
0
-
Yes it is possible, process of routing and filtering requests to a microservice application using the Netflix Zuul edge service library. – Bhushan Uniyal Jan 25 '18 at 10:40
-
Do you have more information or resources? Maybe an example? – StSch Jan 25 '18 at 11:43
-
https://spring.io/guides/gs/routing-and-filtering/ – Bhushan Uniyal Jan 25 '18 at 11:56
1 Answers
1
Yes, I think this is a very common use case. You develop version service-a, version 1, and you want to deploy service-a, version 2, (canary or blue/green) You can deploy both versions, and register both versions with Eureka, and traffic will be sent to both versions. After you verify version 2, you can shut down version 1.

DaShaun
- 3,722
- 2
- 27
- 29