What it won't let me do:
I want to be able to correlate the "out" trace with the "in" trace, in one database row without commiting the row until the route has completed.
This requires a JPA transaction to exist around each of the nodes that are called.
I'm finding that the transaction has ended by the time of the "out" trace.
1. It causes the construction of the new Exchange object and a bunch of String objects that I don't want.
2. It causes the invocation of a new route, that is unnecessary.
I think it would be better to:
1. Pass the class to use as the TraceInterceptor into Tracer.
2. Break the existing TraceInterceptor into two, a base class that tracks the RouteNodes and a subclass that implements traceExchange.
3. Change traceExchange so that it returns an Object and pass that Object in to the call to traceExchange for "out" traces.
4. Give the Tracer a payload object that can be used to pass information to the TraceInterceptor.
5. Change the various trace* functions to take in and return a payload Object.
Custom users could then dervice from TraceInterceptor and override the trace* functions as necessary (probably just traceExchange).
I'm working on a patch.