Class LoadBalancerServiceInstanceCookieFilter

java.lang.Object
org.springframework.cloud.gateway.filter.LoadBalancerServiceInstanceCookieFilter
All Implemented Interfaces:
GlobalFilter, org.springframework.core.Ordered

public class LoadBalancerServiceInstanceCookieFilter extends Object implements GlobalFilter, org.springframework.core.Ordered
A GlobalFilter that allows passing the instanceId) of the ServiceInstance selected by the ReactiveLoadBalancerClientFilter in a cookie.
Since:
3.0.2
Author:
Olga Maciaszek-Sharma
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    LoadBalancerServiceInstanceCookieFilter(org.springframework.cloud.client.loadbalancer.reactive.ReactiveLoadBalancer.Factory<org.springframework.cloud.client.ServiceInstance> loadBalancerClientFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    reactor.core.publisher.Mono<Void>
    filter(org.springframework.web.server.ServerWebExchange exchange, GatewayFilterChain chain)
    Process the Web request and (optionally) delegate to the next GatewayFilter through the given GatewayFilterChain.
    int
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LoadBalancerServiceInstanceCookieFilter

      public LoadBalancerServiceInstanceCookieFilter(org.springframework.cloud.client.loadbalancer.reactive.ReactiveLoadBalancer.Factory<org.springframework.cloud.client.ServiceInstance> loadBalancerClientFactory)
  • Method Details

    • filter

      public reactor.core.publisher.Mono<Void> filter(org.springframework.web.server.ServerWebExchange exchange, GatewayFilterChain chain)
      Description copied from interface: GlobalFilter
      Process the Web request and (optionally) delegate to the next GatewayFilter through the given GatewayFilterChain.
      Specified by:
      filter in interface GlobalFilter
      Parameters:
      exchange - the current server exchange
      chain - provides a way to delegate to the next filter
      Returns:
      Mono<Void> to indicate when request processing is complete
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered