Document lb: prefix and use for websockets.
fixes gh-110
This commit is contained in:
@@ -630,7 +630,7 @@ The `ForwardRoutingFilter` looks for a URI in the exchange attribute `ServerWebE
|
||||
|
||||
=== LoadBalancerClient Filter
|
||||
|
||||
The `LoadBalancerClientFilter` 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 `LoadBalancerClient` 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 `LoadBalancerClientFilter` 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 `LoadBalancerClient` 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.
|
||||
|
||||
=== Netty Routing Filter
|
||||
|
||||
@@ -642,12 +642,16 @@ The `NettyWriteResponseFilter` runs if there is a Netty `HttpClientResponse` in
|
||||
|
||||
=== RouteToRequestUrl Filter
|
||||
|
||||
The `RouteToRequestUrlFilter` runs if there is a `Route` object in the `ServerWebExchangeUtils.GATEWAY_ROUTE_ATTR` exchange attribute. It creates a new URI, based off of the request URI, but updated with the URI attribute of the `Route` object. The new URI is placed in the ``ServerWebExchangeUtils.GATEWAY_REQUEST_URL_ATTR` exchange attribute`.
|
||||
The `RouteToRequestUrlFilter` runs if there is a `Route` object in the `ServerWebExchangeUtils.GATEWAY_ROUTE_ATTR` exchange attribute. It creates a new URI, based off of the request URI, but updated with the URI attribute of the `Route` object. The new URI is placed in the `ServerWebExchangeUtils.GATEWAY_REQUEST_URL_ATTR` exchange attribute`.
|
||||
|
||||
If the URI has a scheme prefix, such as `lb:ws://serviceid`, the `lb` scheme is stripped from the URI and placed in the `ServerWebExchangeUtils.GATEWAY_SCHEME_PREFIX_ATTR` for use later in the filter chain.
|
||||
|
||||
=== Websocket Routing Filter
|
||||
|
||||
The Websocket Routing Filter runs if the url located in the `ServerWebExchangeUtils.GATEWAY_REQUEST_URL_ATTR` exchange attribute has a `ws` or `wss` scheme. It uses the Spring Web Socket infrastructure to forward the Websocket request downstream.
|
||||
|
||||
Websockets may be load-balanced by prefixing the URI with `lb`, such as `lb:ws://serviceid`.
|
||||
|
||||
== Configuration
|
||||
|
||||
Configuration for Spring Cloud Gateway is driven by a collection of `RouteDefinitionLocator`s.
|
||||
|
||||
Reference in New Issue
Block a user