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
TracingChannelInterceptor: simple refactoring #1948
TracingChannelInterceptor: simple refactoring #1948
Conversation
This PR contains a simple and short refactoring of Feel free to merge or reject. The purpose of this PR is more about starting a discussion and possible raising some issues here or there to address later on or immediately. As it turns out the logic of this component is complex enough.
I probably miss something else: feel free to point me out what to pay close attention! We can live for now with what we have so far or let me know if you want we to remove that thread state manipulation for the Thank you for letting me know what is going on in tracing around Spring Integration! |
The changes look nice!
You're suggesting to remove the code from this interceptor and move the whole code to a separate one?
Ok I'll look into that code.
Sure, please update the code then.
Correct, however in between we have a broker so we will see a component in Wavefront / Zipkin called
I'm all for such changes. If this is a new feature though then we should do it in 3.1.x branch. How would you like to proceed with that? |
Thanks Marcin for quick turn around!
Sure, will do soon! And this is a bare minimum we can do for now to keep the code backward compatible.
Sure! Let me see what I can do over there. Probably somewhere next week after releases. |
- Move Spring Cloud Stream classes logic into `static` methods to avoid eager load for those classes which are not present on CP - Remove `emptyMessage()` since the contract for `ChannelInterceptor` never accept a `null` - Remove thread state manipulation from the `postReceive()` since no one takes care about thread local afterwards - Remove `afterReceiveCompletion()` in favor of its `default` impl in the interface: we don't do thread local manipulation for `receive()` since `afterReceiveCompletion()` is called *before* the message is really returned to the target subscriber on the channel
Even if we don't need a thread local store, we still need to call `span.end()` and set an exception tag to it if any. So, just reuse an existing API which includes thread local. Even if we don't need it logically, there might be some other interceptors in between which would like to take a span from thread local do something even on that "void" `receive()` operation
Is it ready to be merged? :) |
Sure thing, Marcin! Yes, it can be merged already if you don't have anything else I should pay attention to. Thanks |
Great. I wonder about one thing. How about we merge this not to |
Sure! However I think those classpath checks I have fixed we can treat as bug and therefore back-port 😄 . |
Ah no, if it's a bug fix then no problem. I'll merge this. |
No description provided.