I would consider just saying exchange.on[Commit|Fail] at the user level.
The reason here is that the Exchange represents... an exchange between endpoints. it *is* the unit of work. Implying that there is a separate transaction it is operating in muddies the waters.
-Brian On Aug 29, 2007, at 1:12 AM, James Strachan wrote:
Incidentally as a first stab at tackling CAMEL-123 https://issues.apache.org/activemq/browse/CAMEL-123 I've added a UnitOfWork object on an Exchange that can be used to register onComplete/onFailure hooks when processing of a message exchange has been completed. Its not yet wired into the sync/async changes Hiram made though but gives an idea of what I was wondering about. If you take a look at the DefaultUnitOfWork.addAsyncStep() - I was kinda wondering if we could use the UnitOfWork object as a factory of AsyncCallback objects when working with async stuff; so that by default when all the async callbacks complete, the UnitOfWork's Synchronization handlers could be invoked (e.g. the onComplete / onFailure handlers). Then my next thought was could we move a bit more of the code from the changes to Pipeline out into the UnitOfWork class; still a bit embyonic my thoughts though - its complex stuff this sync v async v transactions stuff :) -- James ------- http://macstrac.blogspot.com/
