Closed MrWangGang closed 8 months ago
Is there any alternative solution, similar to serviceExchange in WebFlux, where I can retrieve it from anywhere using Mono.deferContextual?
public class RSocketMetadata2Interceptor implements RSocketInterceptor {
@Override
public RSocket apply(RSocket rSocket) {
rSocket.getClass();
return new RSocket() {
@Override
public Flux<Payload> requestStream(Payload payload) {
return rSocket.requestStream(payload).contextWrite(Context.of("ddd","ddd"));
}
};
}
use RSocketInterceptor is ok. why
RSocket support is a Spring Framework feature. Furthermore, as mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. Stack Overflow is a better place for questions like this.
I have an interceptor:
In the interceptor, I put variables into the contextView. Consequently, in the following method:
I attempt to retrieve the contextView through fetchPrincipal:
However, the contextView I obtain is empty. Why is this happening? Could it be that the interceptor is not propagating the context to the subsequent methods?"