Class ReactiveLoadBalancerClientFilter
java.lang.Object
org.springframework.cloud.gateway.filter.ReactiveLoadBalancerClientFilter
- All Implemented Interfaces:
GlobalFilter, org.springframework.core.Ordered
public class ReactiveLoadBalancerClientFilter
extends Object
implements GlobalFilter, org.springframework.core.Ordered
A
GlobalFilter implementation that routes requests using reactive Spring Cloud
LoadBalancer.- Author:
- Spencer Gibb, Tim Ysewyn, Olga Maciaszek-Sharma
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intOrder of filter.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionReactiveLoadBalancerClientFilter(org.springframework.cloud.loadbalancer.support.LoadBalancerClientFactory clientFactory, GatewayLoadBalancerProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void> filter(org.springframework.web.server.ServerWebExchange exchange, GatewayFilterChain chain) Process the Web request and (optionally) delegate to the nextGatewayFilterthrough the givenGatewayFilterChain.intgetOrder()protected URIreconstructURI(org.springframework.cloud.client.ServiceInstance serviceInstance, URI original)
-
Field Details
-
LOAD_BALANCER_CLIENT_FILTER_ORDER
public static final int LOAD_BALANCER_CLIENT_FILTER_ORDEROrder of filter.- See Also:
-
-
Constructor Details
-
ReactiveLoadBalancerClientFilter
public ReactiveLoadBalancerClientFilter(org.springframework.cloud.loadbalancer.support.LoadBalancerClientFactory clientFactory, GatewayLoadBalancerProperties properties)
-
-
Method Details
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
filter
public reactor.core.publisher.Mono<Void> filter(org.springframework.web.server.ServerWebExchange exchange, GatewayFilterChain chain) Description copied from interface:GlobalFilterProcess the Web request and (optionally) delegate to the nextGatewayFilterthrough the givenGatewayFilterChain.- Specified by:
filterin interfaceGlobalFilter- Parameters:
exchange- the current server exchangechain- provides a way to delegate to the next filter- Returns:
Mono<Void>to indicate when request processing is complete
-
reconstructURI
-