Merge branch '2.0.x'

This commit is contained in:
Spencer Gibb
2019-01-08 10:51:49 -05:00
7 changed files with 160 additions and 17 deletions

View File

@@ -1046,9 +1046,16 @@ spring:
- Path=/service/**
----
NOTE By default when a service instance cannot be found in the `LoadBalancer` a `503` will be returned.
NOTE: By default when a service instance cannot be found in the `LoadBalancer` a `503` will be returned.
You can configure the Gateway to return a `404` by setting `spring.cloud.gateway.loadbalancer.use404=true`.
NOTE: The `isSecure` value of the `ServiceInstance` returned from the `LoadBalancer` 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
The Netty Routing Filter runs if the url located in the `ServerWebExchangeUtils.GATEWAY_REQUEST_URL_ATTR` exchange attribute has a `http` or `https` scheme. It uses the Netty `HttpClient` to make the downstream proxy request. The response is put in the `ServerWebExchangeUtils.CLIENT_RESPONSE_ATTR` exchange attribute for use in a later filter. (There is an experimental `WebClientHttpRoutingFilter` that performs the same function, but does not require netty)