TAGS :Viewed: 1 - Published at: a few seconds ago

[ Using Multiple Spring Eureka Discovery Services ]

I have a user request to allow a support tool, which uses Spring Cloud Services, to display a set of links to the same support tool that would exist multiple environments (Dev, Test 1, Test 2, Prod). I am currently connecting via Eureka Server and registering in each of these environments. The current change request is to have a drop down of links of the support tool in each of these environments. Now, I know I can hard code the url of each instance of the support tool that exists in each environment but I would rather use the DiscoveryClient instance from Eureka to gather that information but it looks like the DiscoveryClient (that is autowired) can only connect to instance at time. Not even sure if multiple DiscoveryClients can be used to do this or if what I am wanting is even possible. Any suggestions would be greatly appreciated.

Thanks in advance!

Answer 1

Correct, DiscoveryClient only connects to one eureka server at a time. You would have to create each DiscoveryClient manually. It would probably be easier to use the eureka http api.