0

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?

StanislavL
  • 56,971
  • 9
  • 68
  • 98
StSch
  • 377
  • 1
  • 4
  • 12

1 Answers1

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