Hi I assume the custom logic cannot participate in the same TX as the activeMQ?
You can use onCompletion to store the monitoring after the routing has completed. Then you can check if it was failed or not. And then only store when not failed. http://camel.apache.org/oncompletion.html However since the TX is using the same ActiveMQ to both consume + send a message to it. Then there is a very slight slight slight chance that the TX cannot complete. Have you actually seen any situations where the TX could not commit? On Sat, Sep 1, 2012 at 4:04 PM, Marco Zapletal <[email protected]> wrote: > Hi Camel folks, > > > I have the following route configuration > > from("activemq:q1"). > transacted(). > ... > .inOnly("activemq:q2"). > .inOnly("custom:storeMonitoringInformation") > > > The goal of the second .inOnly ("custom:storeMonitoringInformation") is to > store some monitoring information about the message after it was been > enqueued in q2. However, in case that the transaction commit fails (i.e., > the message could not be inserted in q2), the monitoring entry is stored > anyway. > > What is the recommended solution to deal with this issue - i.e., to wait for > a successful transaction commit before continuing with the route. > > Thanks and best regards, > > Marco -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
