Skip to content

Issue with Trace Context Sharing Across HTTP Requests in Spring WebFlux Application #11283

Answered by laurit
srinusanduri asked this question in Q&A
Discussion options

You must be logged in to vote

I would try wrapping the mono with something like

private static class ContextMono<T> extends Mono<T> {
private final Mono<T> delegate;
private final Context parentContext;
ContextMono(Mono<T> delegate, Context parentContext) {
this.delegate = delegate;
this.parentContext = parentContext;
}
@Override
public void subscribe(CoreSubscriber<? super T> actual) {
try (Scope ignored = parentContext.m…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@srinusanduri
Comment options

@laurit
Comment options

Answer selected by srinusanduri
Comment options

You must be logged in to vote
1 reply
@laurit
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants