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

FluxMessageChannel: propagate the current context from producer to consumer #8889

Closed
artembilan opened this issue Feb 7, 2024 · 0 comments
Closed

Comments

@artembilan
Copy link
Member

There is no connection between producer (FluxMessageChannel.send()) and consumer FluxMessageChannel.subscribe(Subscriber) to propagate the context (typically thread local variables), e.g. an Observation or an Authentication.
Therefore we need to look into mechanism to transport the context via IntegrationMessageHeaderAccessor.REACTOR_CONTEXT message header.

@artembilan artembilan added this to the 6.3.0-M1 milestone Feb 7, 2024
artembilan added a commit that referenced this issue Feb 7, 2024
Fixes: #8889

* Gather the current thread local state for the message into `IntegrationMessageHeaderAccessor.REACTOR_CONTEXT` header
before `this.sink.tryEmitNext(messageToEmit)`
* Restore thread locals for the current message in the `ReactiveStreamsConsumer.SubscriberDecorator` just before `this.delegate.onNext(messageToDeliver)`

**Cherry-pick to `6.2.x`**

(cherry picked from commit dbd46df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants