New module names (#3645)
* New naming convention using webflux and webmvc
The new suffixes are gateway-server-web{flux|mvc} and gateway-proxyexchange-web{flux|mvc}.
This commit updates the starters to use gateway-server-web{flux|mvc} suffixes.
* Adds new spring-cloud-gateway-server-web{flux|mvc} modules.
These simply depend on the old ones. A warning is logged if not using the new module.
* Adds s-c-g-proxyexchange-{webflux|webmvc} modules
* Updates docs for s-c-g-{proxyexchange|server}-{webflux|webmvc} modules
This commit is contained in:
@@ -1,116 +1,116 @@
|
||||
* xref:index.adoc[Introduction]
|
||||
|
||||
// begin Gateway Reactive Server
|
||||
// begin Gateway Server WebFlux
|
||||
|
||||
* xref:spring-cloud-gateway.adoc[]
|
||||
** xref:spring-cloud-gateway/starter.adoc[]
|
||||
** xref:spring-cloud-gateway/glossary.adoc[]
|
||||
** xref:spring-cloud-gateway/how-it-works.adoc[]
|
||||
** xref:spring-cloud-gateway/configuring-route-predicate-factories-and-filter-factories.adoc[]
|
||||
** xref:spring-cloud-gateway/request-predicates-factories.adoc[]
|
||||
** xref:spring-cloud-gateway/gatewayfilter-factories.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/addrequestheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/addrequestheadersifnotpresent-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/addrequestparameter-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/addresponseheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/circuitbreaker-filter-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/cacherequestbody-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/deduperesponseheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/fallback-headers.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/jsontogrpc-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/local-cache-response-filter.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/maprequestheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/modifyrequestbody-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/modifyresponsebody-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/prefixpath-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/preservehostheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/redirectto-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/removejsonattributesresponsebody-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/removerequestheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/removerequestparameter-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/removeresponseheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/requestheadersize-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/requestratelimiter-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/rewritelocationresponseheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/rewritepath-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/rewriterequestparameter-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/rewriteresponseheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/savesession-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/secureheaders-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/setpath-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/setrequestheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/setresponseheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/setstatus-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/stripprefix-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/retry-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/requestsize-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/setrequesthostheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/tokenrelay-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway/gatewayfilter-factories/default-filters.adoc[]
|
||||
** xref:spring-cloud-gateway/global-filters.adoc[]
|
||||
** xref:spring-cloud-gateway/httpheadersfilters.adoc[]
|
||||
** xref:spring-cloud-gateway/tls-and-ssl.adoc[]
|
||||
** xref:spring-cloud-gateway/http-client.adoc[]
|
||||
** xref:spring-cloud-gateway/configuration.adoc[]
|
||||
** xref:spring-cloud-gateway/route-metadata-configuration.adoc[]
|
||||
** xref:spring-cloud-gateway/http-timeouts-configuration.adoc[]
|
||||
** xref:spring-cloud-gateway/fluent-java-routes-api.adoc[]
|
||||
** xref:spring-cloud-gateway/the-discoveryclient-route-definition-locator.adoc[]
|
||||
** xref:spring-cloud-gateway/reactor-netty-access-logs.adoc[]
|
||||
** xref:spring-cloud-gateway/cors-configuration.adoc[]
|
||||
** xref:spring-cloud-gateway/actuator-api.adoc[]
|
||||
** xref:spring-cloud-gateway/sharing-routes.adoc[]
|
||||
** xref:spring-cloud-gateway/troubleshooting.adoc[]
|
||||
** xref:spring-cloud-gateway/developer-guide.adoc[]
|
||||
** xref:spring-cloud-gateway/aot-and-native-image-support.adoc[]
|
||||
** xref:spring-cloud-gateway/configuration-properties.adoc[]
|
||||
* xref:spring-cloud-gateway-server-webflux.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/starter.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/glossary.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/how-it-works.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/configuring-route-predicate-factories-and-filter-factories.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/request-predicates-factories.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/addrequestheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/addrequestheadersifnotpresent-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/addrequestparameter-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/addresponseheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/circuitbreaker-filter-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/cacherequestbody-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/deduperesponseheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/fallback-headers.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/jsontogrpc-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/local-cache-response-filter.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/maprequestheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/modifyrequestbody-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/modifyresponsebody-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/prefixpath-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/preservehostheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/redirectto-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/removejsonattributesresponsebody-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/removerequestheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/removerequestparameter-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/removeresponseheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/requestheadersize-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/requestratelimiter-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/rewritelocationresponseheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/rewritepath-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/rewriterequestparameter-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/rewriteresponseheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/savesession-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/secureheaders-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/setpath-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/setrequestheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/setresponseheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/setstatus-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/stripprefix-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/retry-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/requestsize-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/setrequesthostheader-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/tokenrelay-factory.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/default-filters.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/global-filters.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/httpheadersfilters.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/tls-and-ssl.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/http-client.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/configuration.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/route-metadata-configuration.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/http-timeouts-configuration.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/fluent-java-routes-api.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/the-discoveryclient-route-definition-locator.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/reactor-netty-access-logs.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/cors-configuration.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/actuator-api.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/sharing-routes.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/troubleshooting.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/developer-guide.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/aot-and-native-image-support.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webflux/configuration-properties.adoc[]
|
||||
|
||||
// begin Gateway Server MVC
|
||||
// begin Gateway Server Web MVC
|
||||
|
||||
* xref:spring-cloud-gateway-server-mvc.adoc[]
|
||||
** xref:spring-cloud-gateway-server-mvc/starter.adoc[]
|
||||
** xref:spring-cloud-gateway-server-mvc/glossary.adoc[]
|
||||
** xref:spring-cloud-gateway-server-mvc/how-it-works.adoc[]
|
||||
** xref:spring-cloud-gateway-server-mvc/java-routes-api.adoc[]
|
||||
** xref:spring-cloud-gateway-server-mvc/gateway-request-predicates.adoc[]
|
||||
** xref:spring-cloud-gateway-server-mvc/gateway-handler-filter-functions.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/addrequestheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/addrequestheadersifnotpresent.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/addrequestparameter.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/addresponseheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/circuitbreaker-filter.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/deduperesponseheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/fallback-headers.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/loadbalancer.adoc[]
|
||||
* xref:spring-cloud-gateway-server-webmvc.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webmvc/starter.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webmvc/glossary.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webmvc/how-it-works.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webmvc/java-routes-api.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webmvc/gateway-request-predicates.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webmvc/gateway-handler-filter-functions.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/addrequestheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/addrequestheadersifnotpresent.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/addrequestparameter.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/addresponseheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/circuitbreaker-filter.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/deduperesponseheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/fallback-headers.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/loadbalancer.adoc[]
|
||||
//*** xref:spring-cloud-gateway-server-mvc/filters/local-cache-response-filter.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/maprequestheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/modifyrequestbody.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/modifyresponsebody.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/prefixpath.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/preservehostheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/redirectto.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/maprequestheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/modifyrequestbody.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/modifyresponsebody.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/prefixpath.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/preservehostheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/redirectto.adoc[]
|
||||
//*** xref:spring-cloud-gateway-server-mvc/filters/removejsonattributesresponsebody.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/removerequestheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/removerequestparameter.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/removeresponseheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/requestheadersize.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/ratelimiter.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/rewritelocationresponseheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/rewritepath.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/removerequestheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/removerequestparameter.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/removeresponseheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/requestheadersize.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/ratelimiter.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/rewritelocationresponseheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/rewritepath.adoc[]
|
||||
//*** xref:spring-cloud-gateway-server-mvc/filters/rewriterequestparameter.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/rewriteresponseheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/rewriteresponseheader.adoc[]
|
||||
//*** xref:spring-cloud-gateway-server-mvc/filters/savesession.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/setpath.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/setrequestheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/setresponseheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/setstatus.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/stripprefix.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/retry.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/requestsize.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/setrequesthostheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-mvc/filters/tokenrelay.adoc[]
|
||||
** xref:spring-cloud-gateway-server-mvc/writing-custom-predicates-and-filters.adoc[]
|
||||
** xref:spring-cloud-gateway-server-mvc/working-with-servlets-and-filters.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/setpath.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/setrequestheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/setresponseheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/setstatus.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/stripprefix.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/retry.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/requestsize.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/setrequesthostheader.adoc[]
|
||||
*** xref:spring-cloud-gateway-server-webmvc/filters/tokenrelay.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webmvc/writing-custom-predicates-and-filters.adoc[]
|
||||
** xref:spring-cloud-gateway-server-webmvc/working-with-servlets-and-filters.adoc[]
|
||||
|
||||
// begin Gateway Proxy Exchange
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
[[introduction]]
|
||||
= Spring Cloud Gateway
|
||||
// TODO: docs, rework intro for 4 modules
|
||||
|
||||
This project provides an API Gateway built on top of the Spring Ecosystem, including: Spring 6, Spring Boot 3 and Project Reactor. Spring Cloud Gateway aims to provide a simple, yet effective way to route to APIs and provide cross cutting concerns to them such as: security, monitoring/metrics, and resiliency.
|
||||
|
||||
There are two distinct flavors of Spring Cloud Gateway: *Server* and *Proxy Exchange*. Each flavor offers WebFlux and MVC compatibility.
|
||||
There are two distinct flavors of Spring Cloud Gateway: *Server* and *Proxy Exchange*. Each flavor offers WebFlux and Web MVC compatibility.
|
||||
|
||||
- The Server variant is a full-featured API gateway that can be standalone or embedded in a Spring Boot application.
|
||||
- The Proxy Exchange variant is exclusively for use in annotation based WebFlux or MVC applications and allows the use of a special `ProxyExchange` object as a parameter to a web handler method.
|
||||
- The Proxy Exchange variant is exclusively for use in annotation based WebFlux or Web MVC applications and allows the use of a special `ProxyExchange` object as a parameter to a web handler method.
|
||||
@@ -1,11 +1,11 @@
|
||||
[[proxy-exchange-gateway]]
|
||||
= Proxy Exchange Gateway with Spring MVC or Webflux
|
||||
= Proxy Exchange Gateway with Spring Web MVC or WebFlux
|
||||
|
||||
WARNING: The following describes an alternative style gateway. None of the Spring Cloud Gateway Server documentation applies to what follows.
|
||||
|
||||
== How to Include Spring Cloud Gateway Proxy Exchange
|
||||
|
||||
To include Spring Cloud Gateway Proxy Exchange in your project, use the artifact with a group ID of `org.springframework.cloud` and an artifact ID of `spring-cloud-gateway-mvc` for the MVC Proxy Exchange. For the WebFlux Proxy Exchange use artifact with a group ID of `org.springframework.cloud` and an artifact ID of `spring-cloud-gateway-webflux`.
|
||||
To include Spring Cloud Gateway Proxy Exchange in your project, use the artifact with a group ID of `org.springframework.cloud` and an artifact ID of `spring-cloud-gateway-proxyexchange-webmvc` for the MVC Proxy Exchange. For the WebFlux Proxy Exchange use artifact with a group ID of `org.springframework.cloud` and an artifact ID of `spring-cloud-gateway-proxyexchange-webflux`.
|
||||
|
||||
See the https://projects.spring.io/spring-cloud/[Spring Cloud Project page] for details on setting up your build system with the current Spring Cloud Release Train.
|
||||
|
||||
@@ -15,7 +15,7 @@ Spring Cloud Gateway provides a utility object called `ProxyExchange`.
|
||||
You can use it inside a regular Spring web handler as a method parameter.
|
||||
It supports basic downstream HTTP exchanges through methods that mirror the HTTP verbs.
|
||||
With MVC, it also supports forwarding to a local handler through the `forward()` method.
|
||||
To use the `ProxyExchange`, include the right module in your classpath (either `spring-cloud-gateway-mvc` or `spring-cloud-gateway-webflux`).
|
||||
To use the `ProxyExchange`, include the right module in your classpath (either `spring-cloud-gateway-proxyexchange-webmvc` or `spring-cloud-gateway-proxyexchange-webflux`).
|
||||
|
||||
The following MVC example proxies a request to `/test` downstream to a remote server:
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
[[spring-cloud-gateway-server-mvc]]
|
||||
= Spring Cloud Gateway Server MVC
|
||||
:page-section-summary-toc: 1
|
||||
|
||||
// TODO:
|
||||
@@ -0,0 +1,7 @@
|
||||
[[spring-cloud-gateway-server-webflux]]
|
||||
= Spring Cloud Gateway Server WebFlux
|
||||
:page-section-summary-toc: 1
|
||||
|
||||
*{spring-cloud-version}*
|
||||
|
||||
|
||||
@@ -95,13 +95,13 @@ This will default to `true` in a future release.
|
||||
|
||||
This section details how to retrieve route filters, including:
|
||||
|
||||
* xref:spring-cloud-gateway/actuator-api.adoc#gateway-global-filters[Global Filters]
|
||||
* xref:spring-cloud-gateway-server-webflux/actuator-api.adoc#gateway-global-filters[Global Filters]
|
||||
* <<gateway-route-filters>>
|
||||
|
||||
[[gateway-global-filters]]
|
||||
=== Global Filters
|
||||
|
||||
To retrieve the xref:spring-cloud-gateway/global-filters.adoc[global filters] applied to all routes, make a `GET` request to `/actuator/gateway/globalfilters`. The resulting response is similar to the following:
|
||||
To retrieve the xref:spring-cloud-gateway-server-webflux/global-filters.adoc[global filters] applied to all routes, make a `GET` request to `/actuator/gateway/globalfilters`. The resulting response is similar to the following:
|
||||
|
||||
----
|
||||
{
|
||||
@@ -117,11 +117,11 @@ To retrieve the xref:spring-cloud-gateway/global-filters.adoc[global filters] ap
|
||||
----
|
||||
|
||||
The response contains the details of the global filters that are in place.
|
||||
For each global filter, there is a string representation of the filter object (for example, `org.springframework.cloud.gateway.filter.ReactiveLoadBalancerClientFilter@77856cc5`) and the corresponding xref:spring-cloud-gateway/global-filters.adoc#gateway-combined-global-filter-and-gatewayfilter-ordering[order] in the filter chain.
|
||||
For each global filter, there is a string representation of the filter object (for example, `org.springframework.cloud.gateway.filter.ReactiveLoadBalancerClientFilter@77856cc5`) and the corresponding xref:spring-cloud-gateway-server-webflux/global-filters.adoc#gateway-combined-global-filter-and-gatewayfilter-ordering[order] in the filter chain.
|
||||
|
||||
[[gateway-route-filters]]
|
||||
=== Route Filters
|
||||
To retrieve the xref:spring-cloud-gateway/gatewayfilter-factories.adoc[`GatewayFilter` factories] applied to routes, make a `GET` request to `/actuator/gateway/routefilters`.
|
||||
To retrieve the xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories.adoc[`GatewayFilter` factories] applied to routes, make a `GET` request to `/actuator/gateway/routefilters`.
|
||||
The resulting response is similar to the following:
|
||||
|
||||
----
|
||||
@@ -215,7 +215,7 @@ The following table describes the structure of each element (each is a route) of
|
||||
|
||||
|`route_object.filters`
|
||||
| Array
|
||||
| The xref:spring-cloud-gateway/gatewayfilter-factories.adoc[`GatewayFilter` factories] applied to the route.
|
||||
| The xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories.adoc[`GatewayFilter` factories] applied to the route.
|
||||
|
||||
|`order`
|
||||
| Number
|
||||
@@ -273,14 +273,14 @@ The following table describes the structure of the response:
|
||||
[[creating-and-deleting-a-particular-route-definition]]
|
||||
== Creating and Deleting a Particular Route Definition
|
||||
|
||||
To create a route definition, make a `POST` request to `/gateway/routes/\{id_route_to_create}` with a JSON body that specifies the fields of the route (see xref:spring-cloud-gateway/actuator-api.adoc#gateway-retrieving-information-about-a-particular-route[Retrieving Information about a Particular Route]).
|
||||
To create a route definition, make a `POST` request to `/gateway/routes/\{id_route_to_create}` with a JSON body that specifies the fields of the route (see xref:spring-cloud-gateway-server-webflux/actuator-api.adoc#gateway-retrieving-information-about-a-particular-route[Retrieving Information about a Particular Route]).
|
||||
|
||||
To delete a route definition, make a `DELETE` request to `/gateway/routes/\{id_route_to_delete}`.
|
||||
|
||||
[[creating-multiple-route-definitions]]
|
||||
== Creating multiple Route Definitions
|
||||
|
||||
To create multiple route definitions in a single request, make a `POST` request to `/gateway/routes` with a JSON body that specifies the fields of the route, including the route id (see xref:spring-cloud-gateway/actuator-api.adoc#gateway-retrieving-information-about-a-particular-route[Retrieving Information about a Particular Route]).
|
||||
To create multiple route definitions in a single request, make a `POST` request to `/gateway/routes` with a JSON body that specifies the fields of the route, including the route id (see xref:spring-cloud-gateway-server-webflux/actuator-api.adoc#gateway-retrieving-information-about-a-particular-route[Retrieving Information about a Particular Route]).
|
||||
|
||||
The route definitions will be discarded if any route raises an error during the creation of the routes.
|
||||
|
||||
@@ -121,7 +121,7 @@ In case of the request being forwarded to fallback, the Spring Cloud CircuitBrea
|
||||
It is added to the `ServerWebExchange` as the `ServerWebExchangeUtils.CIRCUITBREAKER_EXECUTION_EXCEPTION_ATTR` attribute that can be used when handling the fallback within the gateway application.
|
||||
|
||||
For the external controller/handler scenario, headers can be added with exception details.
|
||||
You can find more information on doing so in the xref:spring-cloud-gateway/gatewayfilter-factories/fallback-headers.adoc[FallbackHeaders GatewayFilter Factory section].
|
||||
You can find more information on doing so in the xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/fallback-headers.adoc[FallbackHeaders GatewayFilter Factory section].
|
||||
|
||||
[[circuit-breaker-status-codes]]
|
||||
== Tripping The Circuit Breaker On Status Codes
|
||||
@@ -39,5 +39,5 @@ You can overwrite the names of the headers in the configuration by setting the v
|
||||
* `rootCauseExceptionTypeHeaderName` (`"Root-Cause-Exception-Type"`)
|
||||
* `rootCauseExceptionMessageHeaderName` (`"Root-Cause-Exception-Message"`)
|
||||
|
||||
For more information on circuit breakers and the gateway see the xref:spring-cloud-gateway/gatewayfilter-factories/circuitbreaker-filter-factory.adoc[Spring Cloud CircuitBreaker Factory section].
|
||||
For more information on circuit breakers and the gateway see the xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/circuitbreaker-filter-factory.adoc[Spring Cloud CircuitBreaker Factory section].
|
||||
|
||||
@@ -8,7 +8,7 @@ This filter allows caching the response body and headers to follow these rules:
|
||||
* Response data is not cached if `Cache-Control` header does not allow it (`no-store` present in the request or `no-store` or `private` present in the response).
|
||||
* If the response is already cached and a new request is performed with no-cache value in `Cache-Control` header, it returns a bodiless response with 304 (Not Modified).
|
||||
|
||||
This filter configures the local response cache per route and is available only if the `spring.cloud.gateway.filter.local-response-cache.enabled` property is enabled. And a xref:spring-cloud-gateway/global-filters.adoc#local-cache-response-global-filter[local response cache configured globally] is also available as feature.
|
||||
This filter configures the local response cache per route and is available only if the `spring.cloud.gateway.filter.local-response-cache.enabled` property is enabled. And a xref:spring-cloud-gateway-server-webflux/global-filters.adoc#local-cache-response-global-filter[local response cache configured globally] is also available as feature.
|
||||
|
||||
It accepts the first parameter to override the time to expire a cache entry (expressed in `s` for seconds, `m` for minutes, and `h` for hours) and a second parameter to set the maximum size of the cache to evict entries for this route (`KB`, `MB`, or `GB`).
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
The `RequestRateLimiter` `GatewayFilter` factory uses a `RateLimiter` implementation to determine if the current request is allowed to proceed. If it is not, a status of `HTTP 429 - Too Many Requests` (by default) is returned.
|
||||
|
||||
This filter takes an optional `keyResolver` parameter and parameters specific to the rate limiter (described xref:spring-cloud-gateway/gatewayfilter-factories/requestratelimiter-factory.adoc#key-resolver-section[later in this section]).
|
||||
This filter takes an optional `keyResolver` parameter and parameters specific to the rate limiter (described xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/requestratelimiter-factory.adoc#key-resolver-section[later in this section]).
|
||||
|
||||
`keyResolver` is a bean that implements the `KeyResolver` interface.
|
||||
In configuration, reference the bean by name using SpEL.
|
||||
@@ -12,7 +12,7 @@ NOTE: This interface and its usage are subject to change in future milestone rel
|
||||
When a request matches a route, the filtering web handler adds all instances of `GlobalFilter` and all route-specific instances of `GatewayFilter` to a filter chain.
|
||||
This combined filter chain is sorted by the `org.springframework.core.Ordered` interface, which you can set by implementing the `getOrder()` method.
|
||||
|
||||
As Spring Cloud Gateway distinguishes between "`pre`" and "`post`" phases for filter logic execution (see xref:spring-cloud-gateway/how-it-works.adoc[How it Works]), the filter with the highest precedence is the first in the "`pre`"-phase and the last in the "`post`"-phase.
|
||||
As Spring Cloud Gateway distinguishes between "`pre`" and "`post`" phases for filter logic execution (see xref:spring-cloud-gateway-server-webflux/how-it-works.adoc[How it Works]), the filter with the highest precedence is the first in the "`pre`"-phase and the last in the "`post`"-phase.
|
||||
|
||||
The following listing configures a filter chain:
|
||||
|
||||
@@ -86,7 +86,7 @@ This filter also implements the automatic calculation of the `max-age` value in
|
||||
If `max-age` is present on the original response, the value is rewritten with the number of seconds set in the `timeToLive` configuration parameter.
|
||||
In subsequent calls, this value is recalculated with the number of seconds left until the response expires.
|
||||
|
||||
Setting `spring.cloud.gateway.global-filter.local-response-cache.enabled` to `false` deactivate the local response cache for all routes, the xref:spring-cloud-gateway/gatewayfilter-factories/local-cache-response-filter.adoc[LocalResponseCache filter] allows to use this functionality at route level.
|
||||
Setting `spring.cloud.gateway.global-filter.local-response-cache.enabled` to `false` deactivate the local response cache for all routes, the xref:spring-cloud-gateway-server-webflux/gatewayfilter-factories/local-cache-response-filter.adoc[LocalResponseCache filter] allows to use this functionality at route level.
|
||||
|
||||
NOTE: To enable this feature, add `com.github.ben-manes.caffeine:caffeine` and `spring-boot-starter-cache` as project dependencies.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
= How to Include Spring Cloud Gateway
|
||||
:page-section-summary-toc: 1
|
||||
|
||||
To include Spring Cloud Gateway in your project, use the starter with a group ID of `org.springframework.cloud` and an artifact ID of `spring-cloud-starter-gateway`.
|
||||
To include Spring Cloud Gateway in your project, use the starter with a group ID of `org.springframework.cloud` and an artifact ID of `spring-cloud-starter-gateway-server-webflux`.
|
||||
See the https://projects.spring.io/spring-cloud/[Spring Cloud Project page] for details on setting up your build system with the current Spring Cloud Release Train.
|
||||
|
||||
If you include the starter, but you do not want the gateway to be enabled, set `spring.cloud.gateway.enabled=false`.
|
||||
@@ -0,0 +1,5 @@
|
||||
[[spring-cloud-gateway-server-webmvc]]
|
||||
= Spring Cloud Gateway Server Web MVC
|
||||
:page-section-summary-toc: 1
|
||||
|
||||
// TODO:
|
||||
@@ -155,7 +155,7 @@ In case of the request being forwarded to fallback, the Spring Cloud CircuitBrea
|
||||
It is added to the `ServerRequest` as the `MvcUtils.CIRCUITBREAKER_EXECUTION_EXCEPTION_ATTR` attribute that can be used when handling the fallback within the gateway application.
|
||||
|
||||
For the external controller/handler scenario, headers can be added with exception details.
|
||||
You can find more information on doing so in the xref:spring-cloud-gateway-server-mvc/filters/fallback-headers.adoc[FallbackHeaders Filters section].
|
||||
You can find more information on doing so in the xref:spring-cloud-gateway-server-webmvc/filters/fallback-headers.adoc[FallbackHeaders Filters section].
|
||||
|
||||
[[circuit-breaker-status-codes]]
|
||||
== Tripping The Circuit Breaker On Status Codes
|
||||
@@ -67,5 +67,5 @@ You can overwrite the names of the headers in the configuration by setting the v
|
||||
* `rootCauseExceptionTypeHeaderName` (`"Root-Cause-Exception-Type"`)
|
||||
* `rootCauseExceptionMessageHeaderName` (`"Root-Cause-Exception-Message"`)
|
||||
|
||||
For more information on circuit breakers and the gateway see the xref:spring-cloud-gateway-server-mvc/filters/circuitbreaker-filter.adoc[Spring Cloud CircuitBreaker Filter section].
|
||||
For more information on circuit breakers and the gateway see the xref:spring-cloud-gateway-server-webmvc/filters/circuitbreaker-filter.adoc[Spring Cloud CircuitBreaker Filter section].
|
||||
|
||||
@@ -8,7 +8,7 @@ This filter allows caching the response body and headers to follow these rules:
|
||||
* Response data is not cached if `Cache-Control` header does not allow it (`no-store` present in the request or `no-store` or `private` present in the response).
|
||||
* If the response is already cached and a new request is performed with no-cache value in `Cache-Control` header, it returns a bodiless response with 304 (Not Modified).
|
||||
|
||||
This filter configures the local response cache per route and is available only if the `spring.cloud.gateway.filter.local-response-cache.enabled` property is enabled. And a xref:spring-cloud-gateway/global-filters.adoc#local-cache-response-global-filter[local response cache configured globally] is also available as feature.
|
||||
This filter configures the local response cache per route and is available only if the `spring.cloud.gateway.filter.local-response-cache.enabled` property is enabled. And a xref:spring-cloud-gateway-server-webflux/global-filters.adoc#local-cache-response-global-filter[local response cache configured globally] is also available as feature.
|
||||
|
||||
It accepts the first parameter to override the time to expire a cache entry (expressed in `s` for seconds, `m` for minutes, and `h` for hours) and a second parameter to set the maximum size of the cache to evict entries for this route (`KB`, `MB`, or `GB`).
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user