Reputation: 2863
I note that with the various refactoring of common elements into spring cloud commons, the information that you get from auto wiring DiscoveryClient is rather sparse.
Lets say that I want to get more information for the incoming service data that the service gets when it registers with Eureka. Much of what i want is in the Application object.
I know that I could get this detail form the EurekaClient. How can I get access to the EurekaClient object.
Upvotes: 0
Views: 478
Reputation: 25147
I suspect you mean InstanceInfo
objects, since Application
basically just holds a list on InstanceInfo
's. The ServiceInstance
returned from the Spring Cloud DiscoveryClient.getInstances(serviceId)
backed by an InstanceInfo
. My guess is it would be easiest for you to autowire EurekaClient
(or com.netflix.*.DiscoveryClient
if your using an older version) and go from there. We have to be sparse as we support more than just eureka (consul, zookeeper).
Upvotes: 1