diff --git a/docs/modules/ROOT/pages/spring-cloud-netflix.adoc b/docs/modules/ROOT/pages/spring-cloud-netflix.adoc index d4b0456d6..280f3f116 100755 --- a/docs/modules/ROOT/pages/spring-cloud-netflix.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-netflix.adoc @@ -267,25 +267,31 @@ Do not use the `EurekaClient` in a `@PostConstruct` method or in a `@Scheduled` It is initialized in a `SmartLifecycle` (with `phase=0`), so the earliest you can rely on it being available is in another `SmartLifecycle` with a higher phase. ==== -==== EurekaClient with Jersey +==== Underlying HTTP clients + +`EurekaClient` uses either `RestTemplate`, `WebClient` or `JerseyClient` under the hood. In order to use the `EurekaClient`, you need to have one of the supported HTTP clients on your classpath. + +To use `RestTemplate`, add `spring-boot-starter-web` to your dependencies. To use `WebClient`, add `spring-boot-starter-webflux` to your dependencies. If both `RestTemplate` and `WebClient` are on the classpath, when `eureka.client.webclient.enabled` is set to `true`, `WebClient` will be used. Otherwise, `RestTemplate` will be used. -By default, EurekaClient uses Spring's `RestTemplate` for HTTP communication. If you wish to use Jersey instead, you need to add the Jersey dependencies to your classpath. The following example shows the dependencies you need to add: +[source,xml] ---- - - com.sun.jersey - jersey-client - - - com.sun.jersey - jersey-core - - - com.sun.jersey.contribs - jersey-apache-client4 - + + + com.sun.jersey + jersey-client + + + com.sun.jersey + jersey-core + + + com.sun.jersey.contribs + jersey-apache-client4 + + ---- === Alternatives to the Native Netflix EurekaClient