private static ServerBuilder configureService(ServerBuilder sb, HttpHandler httpHandler,
                                                  DataBufferFactoryWrapper<?> factoryWrapper,
                                                  @Nullable String serverHeader) {
        final ArmeriaHttpHandlerAdapter handler =
                new ArmeriaHttpHandlerAdapter(httpHandler, factoryWrapper);
        return sb.route()
                 .addRoute(Route.ofCatchAll())
                 .defaultServiceName("SpringWebFlux")
                 .build((ctx, req) -> {
                     final CompletableFuture<HttpResponse> future = new CompletableFuture<>();
                     final HttpResponse response = HttpResponse.of(future);
                     final Disposable disposable = handler.handle(ctx, req, future, serverHeader).subscribe();
                     response.whenComplete().handle((unused, cause) -> {
                         if (cause != null) {
                             if (ctx.method() != HttpMethod.HEAD) {
                                 logger.debug("{} Response stream has been cancelled.", ctx, cause);
                             }
                             disposable.dispose();
                         }
                         return null;
                     });
                     return response;
                 });
    }
Creates a new factory instance with the specified {@link ConfigurableListableBeanFactory}.
spring/boot3-webflux-autoconfigure/src/main/java/com/linecorp/armeria/spring/web/reactive/ArmeriaReactiveWebServerFactory.java