Added support for reactive service discovery client
This commit is contained in:
@@ -241,10 +241,14 @@ Patterns such as service discovery, load balancing, and circuit breakers lend th
|
||||
=== @EnableDiscoveryClient
|
||||
|
||||
Spring Cloud Commons provides the `@EnableDiscoveryClient` annotation.
|
||||
This looks for implementations of the `DiscoveryClient` interface with `META-INF/spring.factories`.
|
||||
Implementations of the Discovery Client add a configuration class to `spring.factories` under the `org.springframework.cloud.client.discovery.EnableDiscoveryClient` key.
|
||||
This looks for implementations of the `DiscoveryClient` and `ReactiveDiscoveryClient` interfaces with `META-INF/spring.factories`.
|
||||
Implementations of the discovery client add a configuration class to `spring.factories` under the `org.springframework.cloud.client.discovery.EnableDiscoveryClient` key.
|
||||
Examples of `DiscoveryClient` implementations include https://cloud.spring.io/spring-cloud-netflix/[Spring Cloud Netflix Eureka], https://cloud.spring.io/spring-cloud-consul/[Spring Cloud Consul Discovery], and https://cloud.spring.io/spring-cloud-zookeeper/[Spring Cloud Zookeeper Discovery].
|
||||
|
||||
Spring Cloud will provide both the blocking and reactive service discovery clients by default.
|
||||
You can disable the blocking and/or reactive clients easily by setting `spring.cloud.discovery.blocking.enabled=false` or `spring.cloud.discovery.reactive.enabled=false`.
|
||||
To completely disable service discovery you just need to set `spring.cloud.discovery.enabled=false`.
|
||||
|
||||
By default, implementations of `DiscoveryClient` auto-register the local Spring Boot server with the remote discovery server.
|
||||
This behavior can be disabled by setting `autoRegister=false` in `@EnableDiscoveryClient`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user