camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: JMS(local) -to- JMS(remote) bridge
Date Wed, 16 Oct 2013 06:31:31 GMT

Yeah you should use transacted ack mode with JMS on the local AMQ,
then it will only ack the message if it could be send to the remote
broker. And if Camel crashes you wont lose messages as the message is
still stored in the local AMQ persistent store.

AMQ has redelivery built-in, so you can configure how many times to retry etc.

Just mind that with transacted=true, you should set
cacheLevelName=CACHE_CONSUMER to have higher performance. Some details
at: and

ActiveMQ do have a JMS bridge but using Camel has proven to have
higher flexibility and can be easier to configure with various JMS
clients as well

On Tue, Oct 15, 2013 at 11:31 PM, brenuart <> wrote:
> Hello,
> I need to setup a jms bridge to connect a local queue to a remote queue with
> a WAN network connection in between. The bridge must cope with
> unavailability of the remote queue because of network failure for instance:
> messages should stay in the local queue and be transparently redelivered
> when the remote queue becomes reachable.
> (Note: currently using ActiveMQ but may have to switch to HornetQ when in
> production)
> My first thought was to setup a simple Camel route that would consume from
> the local queue and deliver to the remote as follows:
>    <route>
>       <from uri="activemq-local:toremote" />
>       <to uri="activemq-remote:fromlocal" />
>    </route>
> This works great but how would you handle failure (remote not available) and
> retry?
> Should I make the route transacted and rely on broker redelivery (instead of
> Camel redelivery)? The point is I don't want to loose messages in case the
> local Camel instance crashes. As far as I understand, without transaction,
> the message is removed from the queue and held in memory during the retry...
> Should I play with the Camel ErrorHandler and Redelivery policies?
> In other words, how would you do it?
> Thanks for your advices,
> /Bertrand
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Red Hat, Inc.
Twitter: davsclaus
Author of Camel in Action:

View raw message