camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Wait for transaction commit when putting messages on JMS queue using inOnly
Date Thu, 06 Sep 2012 09:33:56 GMT

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.

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 <> 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
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message