diff --git a/reference/html/index.html b/reference/html/index.html index fa7bd6ff..e33efef6 100644 --- a/reference/html/index.html +++ b/reference/html/index.html @@ -136,21 +136,22 @@ $(addBlockSwitches);
  • 2.5. Multiple RestTemplate objects
  • -
  • 2.6. Spring WebFlux WebClient as a Load Balancer Client +
  • 2.6. Multiple WebClient Objects
  • +
  • 2.7. Spring WebFlux WebClient as a Load Balancer Client
  • -
  • 2.7. Ignore Network Interfaces
  • -
  • 2.8. HTTP Client Factories
  • -
  • 2.9. Enabled Features +
  • 2.8. Ignore Network Interfaces
  • +
  • 2.9. HTTP Client Factories
  • +
  • 2.10. Enabled Features
  • -
  • 2.10. Spring Cloud Compatibility Verification
  • +
  • 2.11. Spring Cloud Compatibility Verification
  • 3. Spring Cloud LoadBalancer @@ -958,7 +959,7 @@ public class MyConfiguration {

    2.5. Multiple RestTemplate objects

    If you want a RestTemplate that is not load-balanced, create a RestTemplate bean and inject it. -To access the load-balanced RestTemplate, use the @LoadBalanced qualifier when you create your @Bean, as shown in the following example:\

    +To access the load-balanced RestTemplate, use the @LoadBalanced qualifier when you create your @Bean, as shown in the following example:

    @@ -979,8 +980,8 @@ public class MyConfiguration { } public class MyClass { - @Autowired - private RestTemplate restTemplate; +@Autowired +private RestTemplate restTemplate; @Autowired @LoadBalanced @@ -1022,9 +1023,54 @@ If you see errors such as java.lang.IllegalArgumentException: Can not set
    -

    2.6. Spring WebFlux WebClient as a Load Balancer Client

    +

    2.6. Multiple WebClient Objects

    +
    +

    If you want a WebClient that is not load-balanced, create a WebClient bean and inject it. +To access the load-balanced WebClient, use the @LoadBalanced qualifier when you create your @Bean, as shown in the following example:

    +
    +
    +
    +
    @Configuration
    +public class MyConfiguration {
    +
    +    @LoadBalanced
    +    @Bean
    +    WebClient.Builder loadBalanced() {
    +        return WebClient.builder();
    +    }
    +
    +    @Primary
    +    @Bean
    +    WebClient.Builder webClient() {
    +        return WebClient.builder();
    +    }
    +}
    +
    +public class MyClass {
    +    @Autowired
    +    private WebClient.Builder webClientBuilder;
    +
    +    @Autowired
    +    @LoadBalanced
    +    private WebClient.Builder loadBalanced;
    +
    +    public Mono<String> doOtherStuff() {
    +        return loadBalanced.build().get().uri("http://stores/stores")
    +                        .retrieve().bodyToMono(String.class);
    +    }
    +
    +    public Mono<String> doStuff() {
    +        return webClientBuilder.build().get().uri("http://example.com")
    +                        .retrieve().bodyToMono(String.class);
    +    }
    +}
    +
    +
    +
    +
    +

    2.7. Spring WebFlux WebClient as a Load Balancer Client

    -

    2.6.1. Spring WebFlux WebClient with ReactorLoadBalancerExchangeFilterFunction

    +

    2.7.1. Spring WebFlux WebClient with ReactorLoadBalancerExchangeFilterFunction

    WebClient can be configured to use the ReactiveLoadBalancer. If you add Spring Cloud LoadBalancer starter to your project, @@ -1070,7 +1116,7 @@ to false.

    -

    2.6.2. Spring WebFlux WebClient with non-reactive Load Balancer Client

    +

    2.7.2. Spring WebFlux WebClient with non-reactive Load Balancer Client

    If you you don’t have Spring Cloud LoadBalancer starter in your project, but you do have spring-cloud-starter-netflix-ribbon, you can still use WebClient with LoadBalancerClient. LoadBalancerExchangeFilterFunction @@ -1101,15 +1147,14 @@ The following example shows how to configure a WebClient to use loa The LoadBalancerClient is used to create a full physical address.

    -

    WARN: -This approach is now deprecated. +

    WARN: This approach is now deprecated. We suggest you use WebFlux with reactive Load-Balancer instead.

    -

    2.7. Ignore Network Interfaces

    +

    2.8. Ignore Network Interfaces

    Sometimes, it is useful to ignore certain named network interfaces so that they can be excluded from Service Discovery registration (for example, when running in a Docker container). A list of regular expressions can be set to cause the desired network interfaces to be ignored. @@ -1157,7 +1202,7 @@ The following configuration ignores the docker0 interface and all i

    -

    2.8. HTTP Client Factories

    +

    2.9. HTTP Client Factories

    Spring Cloud Commons provides beans for creating both Apache HTTP clients (ApacheHttpClientFactory) and OK HTTP clients (OkHttpClientFactory). The OkHttpClientFactory bean is created only if the OK HTTP jar is on the classpath. @@ -1168,14 +1213,14 @@ You can also disable the creation of these beans by setting spring.cloud.h

    -

    2.9. Enabled Features

    +

    2.10. Enabled Features

    Spring Cloud Commons provides a /features actuator endpoint. This endpoint returns features available on the classpath and whether they are enabled. The information returned includes the feature type, name, version, and vendor.

    -

    2.9.1. Feature types

    +

    2.10.1. Feature types

    There are two types of 'features': abstract and named.

    @@ -1189,7 +1234,7 @@ The version displayed is bean.getClass().getPackage().getImplementationVer
    -

    2.9.2. Declaring features

    +

    2.10.2. Declaring features

    Any module can declare any number of HasFeature beans, as shown in the following examples:

    @@ -1223,7 +1268,7 @@ HasFeatures localFeatures() {
    -

    2.10. Spring Cloud Compatibility Verification

    +

    2.11. Spring Cloud Compatibility Verification

    Due to the fact that some users have problem with setting up Spring Cloud application, we’ve decided to add a compatibility verification mechanism. It will break if your current setup is not compatible diff --git a/reference/html/spring-cloud-commons.html b/reference/html/spring-cloud-commons.html index fa7bd6ff..e33efef6 100644 --- a/reference/html/spring-cloud-commons.html +++ b/reference/html/spring-cloud-commons.html @@ -136,21 +136,22 @@ $(addBlockSwitches);

  • 2.5. Multiple RestTemplate objects
  • -
  • 2.6. Spring WebFlux WebClient as a Load Balancer Client +
  • 2.6. Multiple WebClient Objects
  • +
  • 2.7. Spring WebFlux WebClient as a Load Balancer Client
  • -
  • 2.7. Ignore Network Interfaces
  • -
  • 2.8. HTTP Client Factories
  • -
  • 2.9. Enabled Features +
  • 2.8. Ignore Network Interfaces
  • +
  • 2.9. HTTP Client Factories
  • +
  • 2.10. Enabled Features
  • -
  • 2.10. Spring Cloud Compatibility Verification
  • +
  • 2.11. Spring Cloud Compatibility Verification
  • 3. Spring Cloud LoadBalancer @@ -958,7 +959,7 @@ public class MyConfiguration {

    2.5. Multiple RestTemplate objects

    If you want a RestTemplate that is not load-balanced, create a RestTemplate bean and inject it. -To access the load-balanced RestTemplate, use the @LoadBalanced qualifier when you create your @Bean, as shown in the following example:\

    +To access the load-balanced RestTemplate, use the @LoadBalanced qualifier when you create your @Bean, as shown in the following example:

    @@ -979,8 +980,8 @@ public class MyConfiguration { } public class MyClass { - @Autowired - private RestTemplate restTemplate; +@Autowired +private RestTemplate restTemplate; @Autowired @LoadBalanced @@ -1022,9 +1023,54 @@ If you see errors such as java.lang.IllegalArgumentException: Can not set
    -

    2.6. Spring WebFlux WebClient as a Load Balancer Client

    +

    2.6. Multiple WebClient Objects

    +
    +

    If you want a WebClient that is not load-balanced, create a WebClient bean and inject it. +To access the load-balanced WebClient, use the @LoadBalanced qualifier when you create your @Bean, as shown in the following example:

    +
    +
    +
    +
    @Configuration
    +public class MyConfiguration {
    +
    +    @LoadBalanced
    +    @Bean
    +    WebClient.Builder loadBalanced() {
    +        return WebClient.builder();
    +    }
    +
    +    @Primary
    +    @Bean
    +    WebClient.Builder webClient() {
    +        return WebClient.builder();
    +    }
    +}
    +
    +public class MyClass {
    +    @Autowired
    +    private WebClient.Builder webClientBuilder;
    +
    +    @Autowired
    +    @LoadBalanced
    +    private WebClient.Builder loadBalanced;
    +
    +    public Mono<String> doOtherStuff() {
    +        return loadBalanced.build().get().uri("http://stores/stores")
    +                        .retrieve().bodyToMono(String.class);
    +    }
    +
    +    public Mono<String> doStuff() {
    +        return webClientBuilder.build().get().uri("http://example.com")
    +                        .retrieve().bodyToMono(String.class);
    +    }
    +}
    +
    +
    +
    +
    +

    2.7. Spring WebFlux WebClient as a Load Balancer Client

    -

    2.6.1. Spring WebFlux WebClient with ReactorLoadBalancerExchangeFilterFunction

    +

    2.7.1. Spring WebFlux WebClient with ReactorLoadBalancerExchangeFilterFunction

    WebClient can be configured to use the ReactiveLoadBalancer. If you add Spring Cloud LoadBalancer starter to your project, @@ -1070,7 +1116,7 @@ to false.

    -

    2.6.2. Spring WebFlux WebClient with non-reactive Load Balancer Client

    +

    2.7.2. Spring WebFlux WebClient with non-reactive Load Balancer Client

    If you you don’t have Spring Cloud LoadBalancer starter in your project, but you do have spring-cloud-starter-netflix-ribbon, you can still use WebClient with LoadBalancerClient. LoadBalancerExchangeFilterFunction @@ -1101,15 +1147,14 @@ The following example shows how to configure a WebClient to use loa The LoadBalancerClient is used to create a full physical address.

    -

    WARN: -This approach is now deprecated. +

    WARN: This approach is now deprecated. We suggest you use WebFlux with reactive Load-Balancer instead.

    -

    2.7. Ignore Network Interfaces

    +

    2.8. Ignore Network Interfaces

    Sometimes, it is useful to ignore certain named network interfaces so that they can be excluded from Service Discovery registration (for example, when running in a Docker container). A list of regular expressions can be set to cause the desired network interfaces to be ignored. @@ -1157,7 +1202,7 @@ The following configuration ignores the docker0 interface and all i

    -

    2.8. HTTP Client Factories

    +

    2.9. HTTP Client Factories

    Spring Cloud Commons provides beans for creating both Apache HTTP clients (ApacheHttpClientFactory) and OK HTTP clients (OkHttpClientFactory). The OkHttpClientFactory bean is created only if the OK HTTP jar is on the classpath. @@ -1168,14 +1213,14 @@ You can also disable the creation of these beans by setting spring.cloud.h

    -

    2.9. Enabled Features

    +

    2.10. Enabled Features

    Spring Cloud Commons provides a /features actuator endpoint. This endpoint returns features available on the classpath and whether they are enabled. The information returned includes the feature type, name, version, and vendor.

    -

    2.9.1. Feature types

    +

    2.10.1. Feature types

    There are two types of 'features': abstract and named.

    @@ -1189,7 +1234,7 @@ The version displayed is bean.getClass().getPackage().getImplementationVer
    -

    2.9.2. Declaring features

    +

    2.10.2. Declaring features

    Any module can declare any number of HasFeature beans, as shown in the following examples:

    @@ -1223,7 +1268,7 @@ HasFeatures localFeatures() {
    -

    2.10. Spring Cloud Compatibility Verification

    +

    2.11. Spring Cloud Compatibility Verification

    Due to the fact that some users have problem with setting up Spring Cloud application, we’ve decided to add a compatibility verification mechanism. It will break if your current setup is not compatible