<p>To include Spring Cloud Gateway in your project use the starter with group <code>org.springframework.cloud</code>
and artifact id <code>spring-cloud-starter-gateway</code>. See the <ahref="https://projects.spring.io/spring-cloud/">Spring Cloud Project page</a>
and artifact id <code>spring-cloud-starter-gateway</code>. See the <ahref="http://projects.spring.io/spring-cloud/">Spring Cloud Project page</a>
for details on setting up your build system with the current Spring Cloud Release Train.</p>
</div>
<divclass="paragraph">
@ -247,10 +247,10 @@ Spring Cloud Gateway requires the Netty runtime provided by Spring Boot and Spri
@@ -247,10 +247,10 @@ Spring Cloud Gateway requires the Netty runtime provided by Spring Boot and Spri
<p><strong>Route</strong>: Route the basic building block of the gateway. It is defined by an ID, a destination URI, a collection of predicates and a collection of filters. A route is matched if aggregate predicate is true.</p>
</li>
<li>
<p><strong>Predicate</strong>: This is a <ahref="https://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html">Java 8 Function Predicate</a>. The input type is a <ahref="https://docs.spring.io/spring/docs/5.0.x/javadoc-api/org/springframework/web/server/ServerWebExchange.html">Spring Framework <code>ServerWebExchange</code></a>. This allows developers to match on anything from the HTTP request, such as headers or parameters.</p>
<p><strong>Predicate</strong>: This is a <ahref="http://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html">Java 8 Function Predicate</a>. The input type is a <ahref="http://docs.spring.io/spring/docs/5.0.x/javadoc-api/org/springframework/web/server/ServerWebExchange.html">Spring Framework <code>ServerWebExchange</code></a>. This allows developers to match on anything from the HTTP request, such as headers or parameters.</p>
</li>
<li>
<p><strong>Filter</strong>: These are instances <ahref="https://docs.spring.io/spring/docs/5.0.x/javadoc-api/org/springframework/web/server/GatewayFilter.html">Spring Framework <code>GatewayFilter</code></a> constructed in with a specific factory. Here, requests and responses can be modified before or after sending the downstream request.</p>
<p><strong>Filter</strong>: These are instances <ahref="http://docs.spring.io/spring/docs/5.0.x/javadoc-api/org/springframework/web/server/GatewayFilter.html">Spring Framework <code>GatewayFilter</code></a> constructed in with a specific factory. Here, requests and responses can be modified before or after sending the downstream request.</p>
</li>
</ul>
</div>
@ -300,7 +300,7 @@ URIs defined in routes without a port will get a default port set to 80 and 443
@@ -300,7 +300,7 @@ URIs defined in routes without a port will get a default port set to 80 and 443
@ -322,7 +322,7 @@ URIs defined in routes without a port will get a default port set to 80 and 443
@@ -322,7 +322,7 @@ URIs defined in routes without a port will get a default port set to 80 and 443
@ -344,7 +344,7 @@ URIs defined in routes without a port will get a default port set to 80 and 443
@@ -344,7 +344,7 @@ URIs defined in routes without a port will get a default port set to 80 and 443
@ -366,7 +366,7 @@ URIs defined in routes without a port will get a default port set to 80 and 443
@@ -366,7 +366,7 @@ URIs defined in routes without a port will get a default port set to 80 and 443
gateway:
routes:
- id: cookie_route
uri: https://example.org
uri: http://example.org
predicates:
- Cookie=chocolate, ch.p</code></pre>
</div>
@ -388,7 +388,7 @@ URIs defined in routes without a port will get a default port set to 80 and 443
@@ -388,7 +388,7 @@ URIs defined in routes without a port will get a default port set to 80 and 443
gateway:
routes:
- id: header_route
uri: https://example.org
uri: http://example.org
predicates:
- Header=X-Request-Id, \d+</code></pre>
</div>
@ -410,7 +410,7 @@ URIs defined in routes without a port will get a default port set to 80 and 443
@@ -410,7 +410,7 @@ URIs defined in routes without a port will get a default port set to 80 and 443
@ -438,7 +438,7 @@ URIs defined in routes without a port will get a default port set to 80 and 443
@@ -438,7 +438,7 @@ URIs defined in routes without a port will get a default port set to 80 and 443
gateway:
routes:
- id: method_route
uri: https://example.org
uri: http://example.org
predicates:
- Method=GET</code></pre>
</div>
@ -460,7 +460,7 @@ URIs defined in routes without a port will get a default port set to 80 and 443
@@ -460,7 +460,7 @@ URIs defined in routes without a port will get a default port set to 80 and 443
@ -656,7 +656,7 @@ If two hops of trusted infrastructure are required before Spring Cloud Gateway i
@@ -656,7 +656,7 @@ If two hops of trusted infrastructure are required before Spring Cloud Gateway i
@ -678,7 +678,7 @@ If two hops of trusted infrastructure are required before Spring Cloud Gateway i
@@ -678,7 +678,7 @@ If two hops of trusted infrastructure are required before Spring Cloud Gateway i
gateway:
routes:
- id: add_request_parameter_route
uri: https://example.org
uri: http://example.org
filters:
- AddRequestParameter=foo, bar</code></pre>
</div>
@ -700,7 +700,7 @@ If two hops of trusted infrastructure are required before Spring Cloud Gateway i
@@ -700,7 +700,7 @@ If two hops of trusted infrastructure are required before Spring Cloud Gateway i
@ -722,7 +722,7 @@ If two hops of trusted infrastructure are required before Spring Cloud Gateway i
@@ -722,7 +722,7 @@ If two hops of trusted infrastructure are required before Spring Cloud Gateway i
@ -741,7 +741,7 @@ If two hops of trusted infrastructure are required before Spring Cloud Gateway i
@@ -741,7 +741,7 @@ If two hops of trusted infrastructure are required before Spring Cloud Gateway i
The Hystrix GatewayFilter allows you to introduce circuit breakers to your gateway routes, protecting your services from cascading failures and allowing you to provide fallback responses in the event of downstream failures.</p>
</div>
<divclass="paragraph">
<p>To enable Hystrix GatewayFilters in your project, add a dependency on <code>spring-cloud-starter-netflix-hystrix</code> from <ahref="https://cloud.spring.io/spring-cloud-netflix/">Spring Cloud Netflix</a>.</p>
<p>To enable Hystrix GatewayFilters in your project, add a dependency on <code>spring-cloud-starter-netflix-hystrix</code> from <ahref="http://cloud.spring.io/spring-cloud-netflix/">Spring Cloud Netflix</a>.</p>
</div>
<divclass="paragraph">
<p>The Hystrix GatewayFilter Factory requires a single <code>name</code> parameter, which is the name of the <code>HystrixCommand</code>.</p>
@ -754,7 +754,7 @@ The Hystrix GatewayFilter allows you to introduce circuit breakers to your gatew
@@ -754,7 +754,7 @@ The Hystrix GatewayFilter allows you to introduce circuit breakers to your gatew
gateway:
routes:
- id: hystrix_route
uri: https://example.org
uri: http://example.org
filters:
- Hystrix=myCommandName</code></pre>
</div>
@ -914,7 +914,7 @@ their default values:</p>
@@ -914,7 +914,7 @@ their default values:</p>
gateway:
routes:
- id: prefixpath_route
uri: https://example.org
uri: http://example.org
filters:
- PrefixPath=/mypath</code></pre>
</div>
@ -936,7 +936,7 @@ their default values:</p>
@@ -936,7 +936,7 @@ their default values:</p>
<p>The SaveSession GatewayFilter Factory forces a <code>WebSession::save</code> operation <em>before</em> forwarding the call downstream. This is of particular use when
using something like <ahref="https://projects.spring.io/spring-session/">Spring Session</a> with a lazy data store and need to ensure the session state has been saved before making the forwarded call.</p>
using something like <ahref="http://projects.spring.io/spring-session/">Spring Session</a> with a lazy data store and need to ensure the session state has been saved before making the forwarded call.</p>
</div>
<divclass="listingblock">
<divclass="title">application.yml</div>
@ -1224,7 +1224,7 @@ using something like <a href="https://projects.spring.io/spring-session/">Spring
@@ -1224,7 +1224,7 @@ using something like <a href="https://projects.spring.io/spring-session/">Spring
gateway:
routes:
- id: save_session
uri: https://example.org
uri: http://example.org
predicates:
- Path=/foo/**
filters:
@ -1232,7 +1232,7 @@ using something like <a href="https://projects.spring.io/spring-session/">Spring
@@ -1232,7 +1232,7 @@ using something like <a href="https://projects.spring.io/spring-session/">Spring
</div>
</div>
<divclass="paragraph">
<p>If you are integrating <ahref="https://projects.spring.io/spring-security/">Spring Security</a> with Spring Session, and want to ensure security details have been forwarded to the remote process, this is critical.</p>
<p>If you are integrating <ahref="http://projects.spring.io/spring-security/">Spring Security</a> with Spring Session, and want to ensure security details have been forwarded to the remote process, this is critical.</p>
</div>
</div>
<divclass="sect2">
@ -1315,7 +1315,7 @@ using something like <a href="https://projects.spring.io/spring-session/">Spring
@@ -1315,7 +1315,7 @@ using something like <a href="https://projects.spring.io/spring-session/">Spring
gateway:
routes:
- id: setpath_route
uri: https://example.org
uri: http://example.org
predicates:
- Path=/foo/{segment}
filters:
@ -1339,7 +1339,7 @@ using something like <a href="https://projects.spring.io/spring-session/">Spring
@@ -1339,7 +1339,7 @@ using something like <a href="https://projects.spring.io/spring-session/">Spring
@ -1361,11 +1361,11 @@ using something like <a href="https://projects.spring.io/spring-session/">Spring
@@ -1361,11 +1361,11 @@ using something like <a href="https://projects.spring.io/spring-session/">Spring
gateway:
routes:
- id: setstatusstring_route
uri: https://example.org
uri: http://example.org
filters:
- SetStatus=BAD_REQUEST
- id: setstatusint_route
uri: https://example.org
uri: http://example.org
filters:
- SetStatus=401</code></pre>
</div>
@ -1935,13 +1935,13 @@ or check if an exchange has already been routed.</p>
@@ -1935,13 +1935,13 @@ or check if an exchange has already been routed.</p>