0

I was reviewing the new features in Dalston. I was curious how to appropriately use the ServiceRegistry for Consul.

In both the register and deregister methods, it uses a ConsulRegistration object. Where do I get this object to us in the deregister?

I checked DiscoveryClient and it seems to return ServiceInstance.

The scenario I am thinking of is to remove zombie services and I was to deregister an instance that I believe is bad.

EvilJinious1
  • 2,773
  • 6
  • 43
  • 63

1 Answers1

0

You can autowire ConsulRegistration object with Spring Boot. The below test class might be helpful for you.

Spring Cloud Consul: ConsulServiceRegistryTests

hiroyukik
  • 713
  • 1
  • 6
  • 14