-
Notifications
You must be signed in to change notification settings - Fork 357
Description
I am trying to pass additional information in subscriber context through the LoadBalancedRSocketMono to my implementation of RSocket. It seems like LoadBalancedRSocketMono does not properly propagate it up the subscription chain.
After debugging it for a bit it looks like subscriber context is present as expected on the
LatencySubscriber child argument. (child.currentContext() has the data), but then it's lost when subscribing to the source.
LB.getRSocket().flatMap(rsocket -> {
return rsocket.requestResponse(request).subscriberContext(resultsSink.currentContext());
})In this case rsocket is the WeightedRSocket from the LB. I see that resultsSink.currentContext() has correct data, but when the call arrives to the actual RSocket wrapped in the WeightedRSocket in a function like this:
@Override
public Mono<Payload> requestResponse(Payload payload) {
return delegate.requestResponse(payload).subscriberContext(ctx -> {
// expecting that higher level subscriber context data would be available here...
// same problem exists when using Mono.subscriberContext()...
return ctx;
});
}I see that ctx is empty and is missing the data that was provided to the WeightedRSocket.
It appears that as LB is creating the handler chain the context is not properly propagated at some point.