Close whole hierarchy at end of message interceptor

Just like in the TraceFilter (web) we need to close the parent
(remote) trace after the message has been processed.
This commit is contained in:
Dave Syer
2015-12-29 17:32:45 +00:00
parent bb2aec9f6a
commit 882e113c87

View File

@@ -45,7 +45,8 @@ public class TraceChannelInterceptor extends ChannelInterceptorAdapter {
@Override
public void postSend(Message<?> message, MessageChannel channel, boolean sent) {
Trace trace = this.traceHolder.get();
this.traceManager.close(trace);
// Double close to clean up the parent (remote span as well)
this.traceManager.close(this.traceManager.close(trace));
this.traceHolder.remove();
}