Mono<Void> handle(ServiceRequestContext ctx, HttpRequest req, CompletableFuture<HttpResponse> future,
                      @Nullable String serverHeader) {
        final ArmeriaServerHttpRequest convertedRequest;
        try {
            convertedRequest = new ArmeriaServerHttpRequest(ctx, req, factoryWrapper);
        } catch (Exception e) {
            final String path = req.path();
            logger.warn("{} Invalid request path: {}", ctx, path, e);
            future.complete(HttpResponse.of(HttpStatus.BAD_REQUEST,
                                            MediaType.PLAIN_TEXT_UTF_8,
                                            HttpStatus.BAD_REQUEST + "\nInvalid request path: " + path));
            return Mono.empty();
        }

        final ArmeriaServerHttpResponse convertedResponse =
                new ArmeriaServerHttpResponse(ctx, future, factoryWrapper, serverHeader);
        return httpHandler.handle(convertedRequest, convertedResponse)
                          .doOnSuccess(unused -> {
                              convertedResponse.setComplete().subscribe();
                          })
                          .doOnError(cause -> {
                              logger.debug("{} Failed to handle a request", ctx, cause);
                              convertedResponse.setComplete(cause).subscribe();
                          })
                          .doOnCancel(() -> {
                              // If Armeria has already returned a response (e.g. RequestTimeout)
                              // make a best effort to reflect this in the returned response
                              final RequestLog requestLog = ctx.log().getIfAvailable(RESPONSE_HEADERS);
                              if (requestLog != null) {
                                  convertedResponse.setRawStatusCode(requestLog.responseStatus().code());
                                  convertedResponse.setComplete().subscribe();
                              }
                          });
    }
An adapter which adapts the {@link HttpHandler} to the Armeria server.
spring/boot3-webflux-autoconfigure/src/main/java/com/linecorp/armeria/spring/web/reactive/ArmeriaHttpHandlerAdapter.java