Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.7.1
-
None
Description
TraceEventHandlers are not called correctly when a node is processed asynchronously.
From org.apache.camel.processor.interceptor.TraceInterceptor:
try {
// special for interceptor where we need to keep booking how far we have routed in the intercepted processors
if (node.getParent() instanceof InterceptDefinition && exchange.getUnitOfWork() != null)
// process the exchange
try
catch (Throwable e)
{ exchange.setException(e); } } finally {
// after (trace out)
if (shouldLog && tracer.isTraceOutExchanges())
}
As it is this results in traceExchangeOut being called before the callback, which is wrong.
The call to super.process needs to wrap the callback to call traceExchangeOut (and the finally block shouldn't run if the process is asynch).
This isn't a regression, but the change to make more routes asynchronous makes it more noticeable.