From 128fa6d27a805629b8e6612abc49a0beef435a8d Mon Sep 17 00:00:00 2001 From: buildmaster Date: Wed, 14 Mar 2018 14:00:45 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- multi/multi_gateway-route-filters.html | 17 ++++++++++------- single/spring-cloud-gateway.html | 17 ++++++++++------- spring-cloud-gateway.xml | 17 ++++++++++------- 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/multi/multi_gateway-route-filters.html b/multi/multi_gateway-route-filters.html index 65fcfc56..53323acc 100644 --- a/multi/multi_gateway-route-filters.html +++ b/multi/multi_gateway-route-filters.html @@ -27,28 +27,31 @@ uri: http://example.org filters: - AddResponseHeader=X-Response-Foo, Bar

-

This will add X-Response-Foo:Bar header to the downstream response’s headers for all matching requests.

5.4 Hystrix GatewayFilter Factory

The Hystrix GatewayFilter Factory takes a single name parameters, which is the name of the HystrixCommand. (More options might be added in future releases).

application.yml.  +

This will add X-Response-Foo:Bar header to the downstream response’s headers for all matching requests.

5.4 Hystrix GatewayFilter Factory

The Hystrix GatewayFilter Factory requires a single name parameter, which is the name of the HystrixCommand.

application.yml. 

spring:
   cloud:
     gateway:
       routes:
-      - id: hytstrix_route
+      - id: hystrix_route
         uri: http://example.org
         filters:
         - Hystrix=myCommandName

-

This wraps the remaining filters in a HystrixCommand with command name myCommandName.

The Hystrix filter takes an optional fallbackUri parameter. Currently, only forward: schemed URIs are supported. If the fallback is called, the request will be forwarded to the controller matched by the URI.

application.yml.  +

This wraps the remaining filters in a HystrixCommand with command name myCommandName.

The Hystrix filter can also accept an optional fallbackUri parameter. Currently, only forward: schemed URIs are supported. If the fallback is called, the request will be forwarded to the controller matched by the URI.

application.yml. 

spring:
   cloud:
     gateway:
       routes:
-      - id: hytstrix_route
-        uri: http://example.org
+      - id: hystrix_route
+        uri: lb://backing-service:8088
+        predicates:
+        - Path=/consumingserviceendpoint
         filters:
         - name: Hystrix
           args:
             name: fallbackcmd
-            fallbackUri: forward:/fallbackcontroller

-

This will forward to the /fallbackcontroller when the Hystrix fallback is called.

5.5 PrefixPath GatewayFilter Factory

The PrefixPath GatewayFilter Factory takes a single prefix parameter.

application.yml.  + fallbackUri: forward:/incaseoffailureusethis + - RewritePath=/consumingserviceendpoint, /backingserviceendpoint

+

This will forward to the /incaseoffailureusethis URI when the Hystrix fallback is called. Note that this example also demonstrates (optional) Spring Cloud Netflix Ribbon load-balancing via the lb prefix on the destination URI.

5.5 PrefixPath GatewayFilter Factory

The PrefixPath GatewayFilter Factory takes a single prefix parameter.

application.yml. 

spring:
   cloud:
     gateway:
diff --git a/single/spring-cloud-gateway.html b/single/spring-cloud-gateway.html
index 8a083906..538eafd5 100644
--- a/single/spring-cloud-gateway.html
+++ b/single/spring-cloud-gateway.html
@@ -128,28 +128,31 @@ for details on setting up your build system with the current Spring Cloud Releas
         uri: http://example.org
         filters:
         - AddResponseHeader=X-Response-Foo, Bar

-

This will add X-Response-Foo:Bar header to the downstream response’s headers for all matching requests.

5.4 Hystrix GatewayFilter Factory

The Hystrix GatewayFilter Factory takes a single name parameters, which is the name of the HystrixCommand. (More options might be added in future releases).

application.yml.  +

This will add X-Response-Foo:Bar header to the downstream response’s headers for all matching requests.

5.4 Hystrix GatewayFilter Factory

The Hystrix GatewayFilter Factory requires a single name parameter, which is the name of the HystrixCommand.

application.yml. 

spring:
   cloud:
     gateway:
       routes:
-      - id: hytstrix_route
+      - id: hystrix_route
         uri: http://example.org
         filters:
         - Hystrix=myCommandName

-

This wraps the remaining filters in a HystrixCommand with command name myCommandName.

The Hystrix filter takes an optional fallbackUri parameter. Currently, only forward: schemed URIs are supported. If the fallback is called, the request will be forwarded to the controller matched by the URI.

application.yml.  +

This wraps the remaining filters in a HystrixCommand with command name myCommandName.

The Hystrix filter can also accept an optional fallbackUri parameter. Currently, only forward: schemed URIs are supported. If the fallback is called, the request will be forwarded to the controller matched by the URI.

application.yml. 

spring:
   cloud:
     gateway:
       routes:
-      - id: hytstrix_route
-        uri: http://example.org
+      - id: hystrix_route
+        uri: lb://backing-service:8088
+        predicates:
+        - Path=/consumingserviceendpoint
         filters:
         - name: Hystrix
           args:
             name: fallbackcmd
-            fallbackUri: forward:/fallbackcontroller

-

This will forward to the /fallbackcontroller when the Hystrix fallback is called.

5.5 PrefixPath GatewayFilter Factory

The PrefixPath GatewayFilter Factory takes a single prefix parameter.

application.yml.  + fallbackUri: forward:/incaseoffailureusethis + - RewritePath=/consumingserviceendpoint, /backingserviceendpoint

+

This will forward to the /incaseoffailureusethis URI when the Hystrix fallback is called. Note that this example also demonstrates (optional) Spring Cloud Netflix Ribbon load-balancing via the lb prefix on the destination URI.

5.5 PrefixPath GatewayFilter Factory

The PrefixPath GatewayFilter Factory takes a single prefix parameter.

application.yml. 

spring:
   cloud:
     gateway:
diff --git a/spring-cloud-gateway.xml b/spring-cloud-gateway.xml
index 98690d34..11267ceb 100644
--- a/spring-cloud-gateway.xml
+++ b/spring-cloud-gateway.xml
@@ -308,7 +308,7 @@ for details on setting up your build system with the current Spring Cloud Releas
 
 
Hystrix GatewayFilter Factory -The Hystrix GatewayFilter Factory takes a single name parameters, which is the name of the HystrixCommand. (More options might be added in future releases). +The Hystrix GatewayFilter Factory requires a single name parameter, which is the name of the HystrixCommand. application.yml @@ -316,14 +316,14 @@ for details on setting up your build system with the current Spring Cloud Releas cloud: gateway: routes: - - id: hytstrix_route + - id: hystrix_route uri: http://example.org filters: - Hystrix=myCommandName This wraps the remaining filters in a HystrixCommand with command name myCommandName. -The Hystrix filter takes an optional fallbackUri parameter. Currently, only forward: schemed URIs are supported. If the fallback is called, the request will be forwarded to the controller matched by the URI. +The Hystrix filter can also accept an optional fallbackUri parameter. Currently, only forward: schemed URIs are supported. If the fallback is called, the request will be forwarded to the controller matched by the URI. application.yml @@ -331,16 +331,19 @@ for details on setting up your build system with the current Spring Cloud Releas cloud: gateway: routes: - - id: hytstrix_route - uri: http://example.org + - id: hystrix_route + uri: lb://backing-service:8088 + predicates: + - Path=/consumingserviceendpoint filters: - name: Hystrix args: name: fallbackcmd - fallbackUri: forward:/fallbackcontroller + fallbackUri: forward:/incaseoffailureusethis + - RewritePath=/consumingserviceendpoint, /backingserviceendpoint -This will forward to the /fallbackcontroller when the Hystrix fallback is called. +This will forward to the /incaseoffailureusethis URI when the Hystrix fallback is called. Note that this example also demonstrates (optional) Spring Cloud Netflix Ribbon load-balancing via the lb prefix on the destination URI.
PrefixPath GatewayFilter Factory