Class GatewayFilterSpec

java.lang.Object
org.springframework.cloud.gateway.route.builder.UriSpec
org.springframework.cloud.gateway.route.builder.GatewayFilterSpec

public class GatewayFilterSpec extends UriSpec
Applies specific filters to routes.
  • Constructor Details

  • Method Details

    • filter

      public GatewayFilterSpec filter(GatewayFilter gatewayFilter)
      Applies the filter to the route.
      Parameters:
      gatewayFilter - the filter to apply
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • filter

      public GatewayFilterSpec filter(GatewayFilter gatewayFilter, int order)
      Applies the filter to the route.
      Parameters:
      gatewayFilter - the filter to apply
      order - the order to apply the filter
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • filter

      public GatewayFilterSpec filter(GatewayFilter gatewayFilter, int order, boolean forceOrder)
      Applies the filter to the route.
      Parameters:
      gatewayFilter - the filter to apply
      order - the order to apply the filter
      forceOrder - if true, then force the order even if the supplied GatewayFilter implements Ordered
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • filters

      public GatewayFilterSpec filters(GatewayFilter... gatewayFilters)
      Applies the list of filters to the route.
      Parameters:
      gatewayFilters - the filters to apply
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • transformToOrderedFilters

      public List<GatewayFilter> transformToOrderedFilters(Stream<GatewayFilter> stream)
    • filters

      public GatewayFilterSpec filters(Collection<GatewayFilter> gatewayFilters)
      Applies the list of filters to the route.
      Parameters:
      gatewayFilters - the filters to apply
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • addRequestHeader

      public GatewayFilterSpec addRequestHeader(String headerName, String headerValue)
      Adds a request header to the request before it is routed by the Gateway.
      Parameters:
      headerName - the header name
      headerValue - the header value
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • addRequestHeadersIfNotPresent

      public GatewayFilterSpec addRequestHeadersIfNotPresent(String... headers)
      Adds a request header to the request before it is routed by the Gateway.
      Parameters:
      headers - the header name(s) and value(s) as 'name-1:value-1,name-2:value-2,...'
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • addRequestParameter

      public GatewayFilterSpec addRequestParameter(String param, String value)
      Adds a request parameter to the request before it is routed by the Gateway.
      Parameters:
      param - the parameter name
      value - the parameter vaule
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • addResponseHeader

      public GatewayFilterSpec addResponseHeader(String headerName, String headerValue)
      Adds a header to the response returned to the Gateway from the route.
      Parameters:
      headerName - the header name
      headerValue - the header value
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • addResponseHeader

      public GatewayFilterSpec addResponseHeader(String headerName, String headerValue, boolean override)
      Adds a header to the response returned to the Gateway from the route.
      Parameters:
      headerName - the header name
      headerValue - the header value
      override - override or not
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • localResponseCache

      public GatewayFilterSpec localResponseCache(@Nullable Duration timeToLive, @Nullable org.springframework.util.unit.DataSize size)
      A filter that adds a local cache for storing response body for repeated requests.

      If `timeToLive` and `size` are null, a global cache is used configured by the global configuration LocalResponseCacheProperties.

      Parameters:
      timeToLive - time an entry is kept in cache. Default: 5 minutes
      size - size expression to limit cache size (See format in DataSize. Default: null (no limit)
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • dedupeResponseHeader

      public GatewayFilterSpec dedupeResponseHeader(String headerName, String strategy)
      A filter that removes duplication on a response header before it is returned to the client by the Gateway.
      Parameters:
      headerName - the header name(s), space separated
      strategy - RETAIN_FIRST, RETAIN_LAST, or RETAIN_UNIQUE
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • circuitBreaker

    • jsonToGRPC

      public GatewayFilterSpec jsonToGRPC(String service, String method, String protoDescriptor)
      A filter that transforms a JSON request into a gRPC one.
      Parameters:
      service - fully qualified name of the service that will handle the request.
      method - method name in the service that will handle the request.
      protoDescriptor - relative path to the proto descriptor file.
    • mapRequestHeader

      public GatewayFilterSpec mapRequestHeader(String fromHeader, String toHeader)
      Maps headers from one name to another.
      Parameters:
      fromHeader - the header name of the original header.
      toHeader - the header name of the new header.
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • modifyRequestBody

      public <T,R> GatewayFilterSpec modifyRequestBody(Class<T> inClass, Class<R> outClass, RewriteFunction<T,R> rewriteFunction)
      A filter that can be used to modify the request body.
      Type Parameters:
      T - the original request body class
      R - the new request body class
      Parameters:
      inClass - the class to convert the incoming request body to
      outClass - the class the Gateway will add to the request before it is routed
      rewriteFunction - the RewriteFunction that transforms the request body
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • modifyRequestBody

      public <T,R> GatewayFilterSpec modifyRequestBody(org.springframework.core.ParameterizedTypeReference<T> inClass, org.springframework.core.ParameterizedTypeReference<R> outClass, RewriteFunction<T,R> rewriteFunction)
      A filter that can be used to modify the request body.
      Type Parameters:
      T - the original request body class
      R - the new request body class
      Parameters:
      inClass - the parameterized type reference to convert the incoming request body to
      outClass - the parameterized type reference the Gateway will add to the request before it is routed
      rewriteFunction - the RewriteFunction that transforms the request body
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • modifyRequestBody

      public <T,R> GatewayFilterSpec modifyRequestBody(Class<T> inClass, Class<R> outClass, @Nullable String newContentType, RewriteFunction<T,R> rewriteFunction)
      A filter that can be used to modify the request body.
      Type Parameters:
      T - the original request body class
      R - the new request body class
      Parameters:
      inClass - the class to convert the incoming request body to
      outClass - the class the Gateway will add to the request before it is routed
      newContentType - the new Content-Type header to be sent
      rewriteFunction - the RewriteFunction that transforms the request body
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • modifyRequestBody

      public <T,R> GatewayFilterSpec modifyRequestBody(org.springframework.core.ParameterizedTypeReference<T> inClass, org.springframework.core.ParameterizedTypeReference<R> outClass, @Nullable String newContentType, RewriteFunction<T,R> rewriteFunction)
      A filter that can be used to modify the request body.
      Type Parameters:
      T - the original request body class
      R - the new request body class
      Parameters:
      inClass - the parameterized type reference to convert the incoming request body to
      outClass - the parameterized type reference the Gateway will add to the request before it is routed
      newContentType - the new Content-Type header to be sent
      rewriteFunction - the RewriteFunction that transforms the request body
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • cacheRequestBody

      public GatewayFilterSpec cacheRequestBody(Class<?> bodyClass)
      A filter that can cache the request body.
      Parameters:
      bodyClass - the class to convert the incoming request body to the original request body class
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • modifyRequestBody

      public <T,R> GatewayFilterSpec modifyRequestBody(Consumer<ModifyRequestBodyGatewayFilterFactory.Config> configConsumer)
      A filter that can be used to modify the request body.
      Type Parameters:
      T - the original request body class
      R - the new request body class
      Parameters:
      configConsumer - request spec for response modification
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
      
      ...
      .modifyRequestBody(c -> c
      	.setInClass(Some.class)
      	.setOutClass(SomeOther.class)
      	.setInHints(hintsIn)
      	.setOutHints(hintsOut)
      	.setRewriteFunction(rewriteFunction))
      
      
    • modifyResponseBody

      public <T,R> GatewayFilterSpec modifyResponseBody(Class<T> inClass, Class<R> outClass, RewriteFunction<T,R> rewriteFunction)
      A filter that can be used to modify the response body.
      Type Parameters:
      T - the original response body class
      R - the new response body class
      Parameters:
      inClass - the class to conver the response body to
      outClass - the class the Gateway will add to the response before it is returned to the client
      rewriteFunction - the RewriteFunction that transforms the response body
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • modifyResponseBody

      public <T,R> GatewayFilterSpec modifyResponseBody(Class<T> inClass, Class<R> outClass, String newContentType, RewriteFunction<T,R> rewriteFunction)
      A filter that can be used to modify the response body.
      Type Parameters:
      T - the original response body class
      R - the new response body class
      Parameters:
      inClass - the class to conver the response body to
      outClass - the class the Gateway will add to the response before it is returned to the client
      newContentType - the new Content-Type header to be returned
      rewriteFunction - the RewriteFunction that transforms the response body
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • modifyResponseBody

      public <T,R> GatewayFilterSpec modifyResponseBody(Consumer<ModifyResponseBodyGatewayFilterFactory.Config> configConsumer)
      A filter that can be used to modify the response body using custom spec.
      Type Parameters:
      T - the original response body class
      R - the new response body class
      Parameters:
      configConsumer - response spec for response modification
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
      
      ...
      .modifyResponseBody(c -> c
      	.setInClass(Some.class)
      	.setOutClass(SomeOther.class)
      	.setOutHints(hintsOut)
      	.setRewriteFunction(rewriteFunction))
      
      
    • prefixPath

      public GatewayFilterSpec prefixPath(String prefix)
      A filter that can be used to add a prefix to the path of a request before it is routed by the Gateway.
      Parameters:
      prefix - the prefix to add to the path
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • preserveHostHeader

      public GatewayFilterSpec preserveHostHeader()
      A filter that will preserve the host header of the request on the outgoing request from the Gateway.
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • setHostHeader

      public GatewayFilterSpec setHostHeader(String hostName)
      A filter that will set the Host header to on the outgoing request.
      Parameters:
      hostName - the updated Host header value
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • redirect

      public GatewayFilterSpec redirect(int status, URI url)
      A filter that will return a redirect response back to the client.
      Parameters:
      status - an HTTP status code, should be a 300 series redirect
      url - the URL to redirect to. This URL will be set in the location header
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • redirect

      public GatewayFilterSpec redirect(int status, URI url, boolean includeRequestParams)
      A filter that will return a redirect response back to the client.
      Parameters:
      status - an HTTP status code, should be a 300 series redirect
      url - the URL to redirect to. This URL will be set in the location header
      includeRequestParams - if true, query params will be passed to the url
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • redirect

      public GatewayFilterSpec redirect(int status, String url)
      A filter that will return a redirect response back to the client.
      Parameters:
      status - an HTTP status code, should be a 300 series redirect
      url - the URL to redirect to. This URL will be set in the location header
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • redirect

      public GatewayFilterSpec redirect(int status, String url, boolean includeRequestParams)
      A filter that will return a redirect response back to the client.
      Parameters:
      status - an HTTP status code, should be a 300 series redirect
      url - the URL to redirect to. This URL will be set in the location header
      includeRequestParams - if true, query params will be passed to the url
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • redirect

      public GatewayFilterSpec redirect(String status, URI url)
      A filter that will return a redirect response back to the client.
      Parameters:
      status - an HTTP status code, should be a 300 series redirect
      url - the URL to redirect to. This URL will be set in the location header
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • redirect

      public GatewayFilterSpec redirect(String status, String url, boolean includeRequestParams)
      A filter that will return a redirect response back to the client.
      Parameters:
      status - an HTTP status code, should be a 300 series redirect
      url - the URL to redirect to. This URL will be set in the location header
      includeRequestParams - if true, query params will be passed to the url
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • redirect

      public GatewayFilterSpec redirect(String status, String url)
      A filter that will return a redirect response back to the client.
      Parameters:
      status - an HTTP status code, should be a 300 series redirect
      url - the URL to redirect to. This URL will be set in the location header
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • redirect

      public GatewayFilterSpec redirect(org.springframework.http.HttpStatus status, URL url)
      A filter that will return a redirect response back to the client.
      Parameters:
      status - an HTTP status code, should be a 300 series redirect
      url - the URL to redirect to. This URL will be set in the location header
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • redirect

      public GatewayFilterSpec redirect(org.springframework.http.HttpStatus status, URL url, boolean includeRequestParams)
      A filter that will return a redirect response back to the client.
      Parameters:
      status - an HTTP status code, should be a 300 series redirect
      url - the URL to redirect to. This URL will be set in the location header
      includeRequestParams - if true, query params will be passed to the url
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • removeJsonAttributes

      public GatewayFilterSpec removeJsonAttributes(String... attributes)
      A filter that can be used to modify the response body. By default, this only removes root attributes.
      Parameters:
      attributes - list of attributes to remove.
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • removeJsonAttributes

      public GatewayFilterSpec removeJsonAttributes(boolean deleteRecursively, String... attributes)
      A filter that can be used to modify the response body.
      Parameters:
      deleteRecursively - if true, all attributes regardless of nesting will be removed.
      attributes - list of attributes to remove.
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • removeRequestHeader

      public GatewayFilterSpec removeRequestHeader(String headerName)
      A filter that will remove a request header before the request is routed by the Gateway.
      Parameters:
      headerName - the name of the header to remove
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • removeRequestParameter

      public GatewayFilterSpec removeRequestParameter(String paramName)
      A filter that will remove a request param before the request is routed by the Gateway.
      Parameters:
      paramName - the name of the header to remove
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • removeResponseHeader

      public GatewayFilterSpec removeResponseHeader(String headerName)
      A filter that will remove a response header before the Gateway returns the response to the client.
      Parameters:
      headerName - the name of the header to remove
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • requestRateLimiter

      public GatewayFilterSpec requestRateLimiter(Consumer<RequestRateLimiterGatewayFilterFactory.Config> configConsumer)
      A filter that will set up a request rate limiter for a route.
      Parameters:
      configConsumer - a Consumer that will return configuration for the rate limiter
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • requestRateLimiter

      public GatewayFilterSpec.RequestRateLimiterSpec requestRateLimiter()
      A filter that will set up a request rate limiter for a route.
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • rewritePath

      public GatewayFilterSpec rewritePath(String regex, String replacement)
      A filter which rewrites the request path before it is routed by the Gateway.
      Parameters:
      regex - a Java regular expression to match the path against
      replacement - the replacement for the path
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • retry

      public GatewayFilterSpec retry(int retries)
      A filter that will retry failed requests. By default 5xx errors and GETs are retryable.
      Parameters:
      retries - max number of retries
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • retry

      A filter that will retry failed requests.
      Parameters:
      retryConsumer - a Consumer which returns a RetryGatewayFilterFactory.RetryConfig to configure the retry functionality
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • retry

      public GatewayFilterSpec retry(reactor.retry.Repeat<org.springframework.web.server.ServerWebExchange> repeat, reactor.retry.Retry<org.springframework.web.server.ServerWebExchange> retry)
      A filter that will retry failed requests.
      Parameters:
      repeat - a Repeat
      retry - a Retry
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • secureHeaders

      public GatewayFilterSpec secureHeaders()
      A filter that adds a number of headers to the response at the reccomendation from this blog post.
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • secureHeaders

      A filter that adds a number of headers to the response at the reccomendation from this blog post.
      Parameters:
      configConsumer - self define headers
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • setPath

      public GatewayFilterSpec setPath(String template)
      A filter that sets the path of the request before it is routed by the Gateway.
      Parameters:
      template - the path to set on the request, allows multiple matching segments using URI templates from Spring Framework
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • setRequestHeader

      public GatewayFilterSpec setRequestHeader(String headerName, String headerValue)
      A filter that sets a header on the request before it is routed by the Gateway.
      Parameters:
      headerName - the header name
      headerValue - the value of the header
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • setResponseHeader

      public GatewayFilterSpec setResponseHeader(String headerName, String headerValue)
      A filter that sets a header on the response before it is returned to the client by the Gateway.
      Parameters:
      headerName - the header name
      headerValue - the value of the header
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • rewriteResponseHeader

      public GatewayFilterSpec rewriteResponseHeader(String headerName, String regex, String replacement)
      A filter that rewrites a header value on the response before it is returned to the client by the Gateway.
      Parameters:
      headerName - the header name
      regex - a Java regular expression to match the path against
      replacement - the replacement for the path
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • rewriteLocationResponseHeader

      public GatewayFilterSpec rewriteLocationResponseHeader(String stripVersionMode, String locationHeaderName, String hostValue, String protocolsRegex)
      A filter that rewrites the value of Location response header, ridding it of backend specific details.
      Parameters:
      stripVersionMode - NEVER_STRIP, AS_IN_REQUEST, or ALWAYS_STRIP
      locationHeaderName - a location header name
      hostValue - host value
      protocolsRegex - a valid regex String, against which the protocol name will be matched
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • rewriteRequestParameter

      public GatewayFilterSpec rewriteRequestParameter(String name, String replacement)
      A filter that rewrites the value of a request parameter
      Parameters:
      name - The name of the request parameter to replace
      replacement - The new value for the request parameter
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • setStatus

      public GatewayFilterSpec setStatus(int status)
      A filter that sets the status on the response before it is returned to the client by the Gateway.
      Parameters:
      status - the status to set on the response
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • setStatus

      public GatewayFilterSpec setStatus(org.springframework.http.HttpStatus status)
      A filter that sets the status on the response before it is returned to the client by the Gateway.
      Parameters:
      status - the status to set on the response
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • setStatus

      public GatewayFilterSpec setStatus(String status)
      A filter that sets the status on the response before it is returned to the client by the Gateway.
      Parameters:
      status - the status to set on the response
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • saveSession

      public GatewayFilterSpec saveSession()
      A filter which forces a WebSession::save operation before forwarding the call downstream. This is of particular use when using something like Spring Session with a lazy data store and need to ensure the session state has been saved before making the forwarded call. If you are integrating Spring Security with Spring Session, and want to ensure security details have been forwarded to the remote process, this is critical.
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • stripPrefix

      public GatewayFilterSpec stripPrefix(int parts)
      Strips the prefix from the path of the request before it is routed by the Gateway.
      Parameters:
      parts - the number of parts of the path to remove
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • requestHeaderToRequestUri

      public GatewayFilterSpec requestHeaderToRequestUri(String headerName)
      A filter which changes the URI the request will be routed to by the Gateway by pulling it from a header on the request.
      Parameters:
      headerName - the header name containing the URI
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • setRequestUri

      public GatewayFilterSpec setRequestUri(String uri)
      A filter which changes the URI the request will be routed to by the Gateway by pulling it from a header on the request.
      Parameters:
      uri - the URI
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • changeRequestUri

      public GatewayFilterSpec changeRequestUri(Function<org.springframework.web.server.ServerWebExchange, Optional<URI>> determineRequestUri)
      A filter which change the URI the request will be routed to by the Gateway.
      Parameters:
      determineRequestUri - a Function which takes a ServerWebExchange and returns a URI to route the request to
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • setRequestSize

      public GatewayFilterSpec setRequestSize(Long size)
      A filter that sets the maximum permissible size of a Content-Length header value in the Request.
      Parameters:
      size - the maximum size of a request
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • setRequestSize

      public GatewayFilterSpec setRequestSize(org.springframework.util.unit.DataSize size)
      A filter that sets the maximum permissible size of a Content-Length header value in the Request.
      Parameters:
      size - the maximum size of a request
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • setRequestHeaderSize

      public GatewayFilterSpec setRequestHeaderSize(org.springframework.util.unit.DataSize size)
      A filter that sets the maximum permissible size of headers of Request.
      Parameters:
      size - the maximum size of header of request
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • tokenRelay

      public GatewayFilterSpec tokenRelay()
      A filter that enables token relay by extracting the access token from the currently authenticated user and puts it in a request header for downstream requests.
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • tokenRelay

      public GatewayFilterSpec tokenRelay(String clientRegistrationId)
      A filter that enables token relay by extracting the access token of a specified ClientRegistration and puts it in a request header for downstream requests.
      Parameters:
      clientRegistrationId - the client registration id to use for building the authorization request
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • fallbackHeaders

      Adds hystrix execution exception headers to fallback request. Depends on @{code org.springframework.cloud::spring-cloud-starter-netflix-hystrix} being on the classpath,
      Parameters:
      config - a FallbackHeadersGatewayFilterFactory.Config which provides the header names. If header names arguments are not provided, default values are used.
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters
    • fallbackHeaders

      public GatewayFilterSpec fallbackHeaders(Consumer<FallbackHeadersGatewayFilterFactory.Config> configConsumer)
      Adds hystrix execution exception headers to fallback request. Depends on @{code org.springframework.cloud::spring-cloud-starter-netflix-hystrix} being on the classpath,
      Parameters:
      configConsumer - a Consumer which can be used to set up the names of the headers in the config. If header names arguments are not provided, default values are used.
      Returns:
      a GatewayFilterSpec that can be used to apply additional filters