Class ReversedProxyHandlerMapping
- java.lang.Object
-
- org.springframework.context.support.ApplicationObjectSupport
-
- org.springframework.web.reactive.handler.AbstractHandlerMapping
-
- io.microsphere.spring.webflux.handler.ReversedProxyHandlerMapping
-
- All Implemented Interfaces:
java.util.EventListener,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener<WebEndpointMappingsReadyEvent>,org.springframework.core.Ordered,org.springframework.web.reactive.HandlerMapping
public class ReversedProxyHandlerMapping extends org.springframework.web.reactive.handler.AbstractHandlerMapping implements org.springframework.context.ApplicationListener<WebEndpointMappingsReadyEvent>
The performance optimizationHandlerMappingto process the forwarded request from the reversed proxy web server, e.g, Spring Cloud Netflix Zuul, Spring Cloud Gateway or others. The request must have a header named"microsphere_wem_id", which is a string presentingthe id of endpoint, used to locate the actualendpointeasily, such asHandlerMethod,HandlerFunction.As a result,
ReversedProxyHandlerMappinghas the higher precedence than others, which ensures that it prioritizesgetting the handlerand avoid the duplication that was executed by the reversed proxy. As regards the details ofendpoint, it's recommended to read the JavaDoc ofWebEndpointMapping.getEndpoint().For now,
ReversedProxyHandlerMappingonly supports to get the handlers fromRequestMappingHandlerMapping.- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
WebEndpointMapping,AbstractUrlHandlerMapping,AbstractHandlerMethodMapping,HandlerMetadataWebEndpointMappingFactory,RequestMappingMetadataWebEndpointMappingFactory,RequestMappingInfoHandlerMapping
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_ORDER-
Fields inherited from class org.springframework.web.reactive.handler.AbstractHandlerMapping
mappingsLogger
-
-
Constructor Summary
Constructors Constructor Description ReversedProxyHandlerMapping()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected reactor.core.publisher.Mono<?>getHandlerInternal(WebEndpointMapping webEndpointMapping)protected reactor.core.publisher.Mono<?>getHandlerInternal(org.springframework.web.server.ServerWebExchange serverWebExchange)voidonApplicationEvent(WebEndpointMappingsReadyEvent event)-
Methods inherited from class org.springframework.web.reactive.handler.AbstractHandlerMapping
formatMappingName, getCorsConfiguration, getCorsProcessor, getHandler, getOrder, getPathPatternParser, hasCorsConfigurationSource, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setOrder, setUseCaseSensitiveMatch, setUseTrailingSlashMatch
-
-
-
-
Field Detail
-
DEFAULT_ORDER
public static final int DEFAULT_ORDER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getHandlerInternal
protected reactor.core.publisher.Mono<?> getHandlerInternal(org.springframework.web.server.ServerWebExchange serverWebExchange)
- Specified by:
getHandlerInternalin classorg.springframework.web.reactive.handler.AbstractHandlerMapping
-
getHandlerInternal
@Nullable protected reactor.core.publisher.Mono<?> getHandlerInternal(WebEndpointMapping webEndpointMapping)
-
onApplicationEvent
public void onApplicationEvent(WebEndpointMappingsReadyEvent event)
- Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<WebEndpointMappingsReadyEvent>
-
-