From f4edafc9daf5644909dee79ba48739ad41db7137 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Fri, 13 Sep 2019 10:17:38 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- reference/html/index.html | 70 ++++++++++++++++++++++++ reference/html/spring-cloud-gateway.html | 70 ++++++++++++++++++++++++ 2 files changed, 140 insertions(+) diff --git a/reference/html/index.html b/reference/html/index.html index 6de5613b..1778c3cb 100644 --- a/reference/html/index.html +++ b/reference/html/index.html @@ -153,6 +153,7 @@ $(addBlockSwitches);
  • Combined Global Filter and GatewayFilter Ordering
  • Forward Routing Filter
  • LoadBalancerClient Filter
  • +
  • ReactiveLoadBalancerClientFilter
  • Netty Routing Filter
  • Netty Write Response Filter
  • RouteToRequestUrl Filter
  • @@ -2016,6 +2017,75 @@ route URL will override the ServiceInstance configuration. +
    + + + + + +
    + + +LoadBalancerClientFilter uses a blocking Ribbon LoadBalancerClient under the hood. +We suggest you use ReactiveLoadBalancerClientFilter instead. +You can switch to using it by setting the value of the spring.cloud.loadbalancer.ribbon.enabled to false. +
    +
    + +
    +

    ReactiveLoadBalancerClientFilter

    +
    +

    The ReactiveLoadBalancerClientFilter looks for a URI in the exchange attribute +ServerWebExchangeUtils.GATEWAY_REQUEST_URL_ATTR. If the url has a lb scheme (ie lb://myservice), +it will use the Spring Cloud ReactorLoadBalancer to resolve the name (myservice in the previous example) +to an actual host and port and replace the URI in the same attribute. The unmodified +original url is appended to the list in the ServerWebExchangeUtils.GATEWAY_ORIGINAL_REQUEST_URL_ATTR attribute. +The filter will also look in the ServerWebExchangeUtils.GATEWAY_SCHEME_PREFIX_ATTR attribute to see if it equals +lb and then the same rules apply.

    +
    +
    +
    application.yml
    +
    +
    spring:
    +  cloud:
    +    gateway:
    +      routes:
    +      - id: myRoute
    +        uri: lb://service
    +        predicates:
    +        - Path=/service/**
    +
    +
    +
    + + + + + +
    + + +By default when a service instance cannot be found by the ReactorLoadBalancer, a 503 will be returned. +You can configure the Gateway to return a 404 by setting spring.cloud.gateway.loadbalancer.use404=true. +
    +
    +
    + + + + + +
    + + +The isSecure value of the ServiceInstance returned from the ReactiveLoadBalancerClientFilter will override +the scheme specified in the request made to the Gateway. For example, if the request comes into the Gateway over HTTPS +but the ServiceInstance indicates it is not secure, then the downstream request will be made over +HTTP. The opposite situation can also apply. However if GATEWAY_SCHEME_PREFIX_ATTR is specified for the +route in the Gateway configuration, the prefix will be stripped and the resulting scheme from the +route URL will override the ServiceInstance configuration. +
    +

    Netty Routing Filter

    diff --git a/reference/html/spring-cloud-gateway.html b/reference/html/spring-cloud-gateway.html index 6de5613b..1778c3cb 100644 --- a/reference/html/spring-cloud-gateway.html +++ b/reference/html/spring-cloud-gateway.html @@ -153,6 +153,7 @@ $(addBlockSwitches);
  • Combined Global Filter and GatewayFilter Ordering
  • Forward Routing Filter
  • LoadBalancerClient Filter
  • +
  • ReactiveLoadBalancerClientFilter
  • Netty Routing Filter
  • Netty Write Response Filter
  • RouteToRequestUrl Filter
  • @@ -2016,6 +2017,75 @@ route URL will override the ServiceInstance configuration.
    +
    + + + + + +
    + + +LoadBalancerClientFilter uses a blocking Ribbon LoadBalancerClient under the hood. +We suggest you use ReactiveLoadBalancerClientFilter instead. +You can switch to using it by setting the value of the spring.cloud.loadbalancer.ribbon.enabled to false. +
    +
    + +
    +

    ReactiveLoadBalancerClientFilter

    +
    +

    The ReactiveLoadBalancerClientFilter looks for a URI in the exchange attribute +ServerWebExchangeUtils.GATEWAY_REQUEST_URL_ATTR. If the url has a lb scheme (ie lb://myservice), +it will use the Spring Cloud ReactorLoadBalancer to resolve the name (myservice in the previous example) +to an actual host and port and replace the URI in the same attribute. The unmodified +original url is appended to the list in the ServerWebExchangeUtils.GATEWAY_ORIGINAL_REQUEST_URL_ATTR attribute. +The filter will also look in the ServerWebExchangeUtils.GATEWAY_SCHEME_PREFIX_ATTR attribute to see if it equals +lb and then the same rules apply.

    +
    +
    +
    application.yml
    +
    +
    spring:
    +  cloud:
    +    gateway:
    +      routes:
    +      - id: myRoute
    +        uri: lb://service
    +        predicates:
    +        - Path=/service/**
    +
    +
    +
    + + + + + +
    + + +By default when a service instance cannot be found by the ReactorLoadBalancer, a 503 will be returned. +You can configure the Gateway to return a 404 by setting spring.cloud.gateway.loadbalancer.use404=true. +
    +
    +
    + + + + + +
    + + +The isSecure value of the ServiceInstance returned from the ReactiveLoadBalancerClientFilter will override +the scheme specified in the request made to the Gateway. For example, if the request comes into the Gateway over HTTPS +but the ServiceInstance indicates it is not secure, then the downstream request will be made over +HTTP. The opposite situation can also apply. However if GATEWAY_SCHEME_PREFIX_ATTR is specified for the +route in the Gateway configuration, the prefix will be stripped and the resulting scheme from the +route URL will override the ServiceInstance configuration. +
    +

    Netty Routing Filter