spring-bootspring-cloudspring-cloud-consul

Is there a flag to disable discovery in spring cloud consul?


Is it possible to disable the service discovery in cloud consul but still keep the registration.

Similar to how one can disable the auto registration but keeps discovery like @EnableDiscoveryClient(autoRegisters=false)


Solution

  • spring.cloud.consul.discovery.enabled=false will disable the consul DiscoveryClient. There is no java/annotation way to do it.