public class AsityHandlerFunction extends Object implements HandlerFunction<ServerResponse>
SpringWebFluxServerHttpExchange.
@Bean
public AsityHandlerFunction handlerFunction() {
return new AsityHandlerFunction().on(http -> {});
}
@Bean
public RouterFunction<ServerResponse> httpMapping() {
return RouterFunction<ServerResponse> routes = RouterFunctions.route(
path("/cettia")
// To exclude WebSocket handshake requests
.and(headers(headers -> !"websocket".equalsIgnoreCase(headers.asHttpHeaders().getUpgrade()))),
handlerFunction());
}
| Constructor and Description |
|---|
AsityHandlerFunction() |
| Modifier and Type | Method and Description |
|---|---|
Mono<ServerResponse> |
handle(ServerRequest request) |
AsityHandlerFunction |
onhttp(Action<ServerHttpExchange> action)
Registers an action to be called when
ServerHttpExchange is available. |
public Mono<ServerResponse> handle(ServerRequest request)
handle in interface HandlerFunction<ServerResponse>public AsityHandlerFunction onhttp(Action<ServerHttpExchange> action)
ServerHttpExchange is available.Copyright © 2015–2018. All rights reserved.