Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move blocking context creation to boundedElastic thread #215

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -34,7 +35,8 @@ public Mono<Void> 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<Void> handle(ServerHttpRequest request, ServerHttpResponse response, ContextView context) {
Expand Down