EvilJinious1
EvilJinious1

Reputation: 2863

Getting more detail from the Spring cloud Discovery Client

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

Answers (1)

spencergibb
spencergibb

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

Related Questions