use of reactor.ipc.netty.http.server.HttpServerRequest in project spring-framework by spring-projects.
the class ReactorHttpHandlerAdapter method apply.
@Override
public Mono<Void> apply(HttpServerRequest request, HttpServerResponse response) {
NettyDataBufferFactory bufferFactory = new NettyDataBufferFactory(response.alloc());
ReactorServerHttpRequest req = new ReactorServerHttpRequest(request, bufferFactory);
ReactorServerHttpResponse resp = new ReactorServerHttpResponse(response, bufferFactory);
return this.httpHandler.handle(req, resp).otherwise(ex -> {
logger.error("Could not complete request", ex);
response.status(HttpResponseStatus.INTERNAL_SERVER_ERROR);
return Mono.empty();
}).doOnSuccess(aVoid -> logger.debug("Successfully completed request"));
}
Aggregations