Merge branch 'master' into 2.0.x

This commit is contained in:
Spencer Gibb
2017-10-23 21:22:20 -04:00
27 changed files with 671 additions and 51 deletions

View File

@@ -688,6 +688,9 @@ turbine:
appConfig: customers
----
If you need to customize which cluster names should be used by Turbine (you don't want to store cluster names in
`turbine.aggregator.clusterConfig` configuration) provide a bean of type `TurbineClustersProvider`.
The `clusterName` can be customized by a SPEL expression in `turbine.clusterNameExpression` with root an instance of `InstanceInfo`. The default value is `appName`, which means that the Eureka serviceId ends up as the cluster key (i.e. the `InstanceInfo` for customers has an `appName` of "CUSTOMERS"). A different example would be `turbine.clusterNameExpression=aSGName`, which would get the cluster name from the AWS ASG name. Another example:
----
@@ -830,6 +833,7 @@ To set the `IRule` for a service name `users` you could set the following:
----
users:
ribbon:
NIWSServerListClassName: com.netflix.loadbalancer.ConfigurationBasedServerList
NFLoadBalancerRuleClassName: com.netflix.loadbalancer.WeightedResponseTimeRule
----
@@ -1497,9 +1501,39 @@ The location of the backend can be specified as either a "serviceId"
url: http://example.com/users_service
----
These simple url-routes don't get executed as a `HystrixCommand` nor can you loadbalance multiple URLs with Ribbon.
To achieve this, specify a service-route and configure a Ribbon client for the
serviceId (this currently requires disabling Eureka support in Ribbon:
These simple url-routes don't get executed as a `HystrixCommand` nor do they loadbalance multiple URLs with Ribbon.
To achieve this, you can specify a `serviceId` with a static list of servers:
.application.yml
[source,yaml]
----
zuul:
routes:
echo:
path: /myusers/**
serviceId: myusers-service
stripPrefix: true
hystrix:
command:
myusers-service:
execution:
isolation:
thread:
timeoutInMilliseconds: ...
myusers-service:
ribbon:
NIWSServerListClassName: com.netflix.loadbalancer.ConfigurationBasedServerList
ListOfServers: http://example1.com,http://example2.com
ConnectTimeout: 1000
ReadTimeout: 3000
MaxTotalHttpConnections: 500
MaxConnectionsPerHost: 100
----
Another method is specifiying a service-route and configure a Ribbon client for the
serviceId (this requires disabling Eureka support in Ribbon:
see <<spring-cloud-ribbon-without-eureka,above for more information>>), e.g.
.application.yml
@@ -1697,11 +1731,17 @@ Security. The assumption in this case is that the downstream services
might add these headers too, and we want the values from the proxy.
To not discard these well known security headers in case Spring Security is on the classpath you can set `zuul.ignoreSecurityHeaders` to `false`. This can be useful if you disabled the HTTP Security response headers in Spring Security and want the values provided by downstream services
=== The Routes Endpoint
=== Management Endpoints
If you are using `@EnableZuulProxy` with tha Spring Boot Actuator you
will enable (by default) an additional endpoint, available via HTTP as
`/routes`. A GET to this endpoint will return a list of the mapped
If you are using `@EnableZuulProxy` with the Spring Boot Actuator you
will enable (by default) two additional endpoints:
* Routes
* Filters
==== Routes Endpoint
A GET to the routes endpoint at `/routes` will return a list of the mapped
routes:
.GET /routes
@@ -1740,6 +1780,12 @@ NOTE: the routes should respond automatically to changes in the
service catalog, but the POST to /routes is a way to force the change
to happen immediately.
==== Filters Endpoint
A GET to the filters endpoint at `/filters` will return a map of Zuul
filters by type. For each filter type in the map, you will find a list
of all the filters of that type, along with their details.
=== Strangulation Patterns and Local Forwards
A common pattern when migrating an existing application or API is to