From 53c6bb40f7bb1b93911cbc15e00bcc87ac3c592b Mon Sep 17 00:00:00 2001 From: Aroooba Date: Wed, 12 Jul 2023 16:39:20 +0900 Subject: [PATCH] Move blocking context creation to boundedElastic thread --- .../logging/web/LoggingContextHttpHandlerDecorator.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qudini-reactive-logging/src/main/java/com/qudini/reactive/logging/web/LoggingContextHttpHandlerDecorator.java b/qudini-reactive-logging/src/main/java/com/qudini/reactive/logging/web/LoggingContextHttpHandlerDecorator.java index 55b98cf8..0df7aef6 100644 --- a/qudini-reactive-logging/src/main/java/com/qudini/reactive/logging/web/LoggingContextHttpHandlerDecorator.java +++ b/qudini-reactive-logging/src/main/java/com/qudini/reactive/logging/web/LoggingContextHttpHandlerDecorator.java @@ -8,6 +8,7 @@ import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.http.server.reactive.ServerHttpResponse; import reactor.core.publisher.Mono; +import reactor.core.scheduler.Schedulers; import reactor.util.context.ContextView; import java.util.Map; @@ -34,7 +35,8 @@ public Mono handle(ServerHttpRequest request, ServerHttpResponse response) extractLoggingContext(request) ) .map(onBoth(reactiveLoggingContextCreator::create)) - .flatMap(context -> handle(request, response, context)); + .flatMap(context -> handle(request, response, context)) + .subscribeOn(Schedulers.boundedElastic()); } private Mono handle(ServerHttpRequest request, ServerHttpResponse response, ContextView context) {