camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Retrying queue
Date Fri, 10 Jul 2009 10:42:38 GMT
On Fri, Jul 10, 2009 at 11:19 AM, Leen Toelen<> wrote:
> Hi,
> I would like to use an synchronous queueing mechanism, where the processing
> (posting to an HTTP endpoint) is retried muliple times on failure. The retry
> schedule schould be manageable so the retry timer increments and in the end
> a warning is provided, much like most email servers work. The queue should
> work reliably, and be as simple as possible (journal backend, no remoting,
> no management). The activemq journal component comes close, but I don't know
> if an endpoint can resubmit failed messages for later processing.
> Does camel have such a component (or combination of components)?

Welcome to the Camel community.

You can use ActiveMQ for the queue and use persistent queues. Then
your messages will not get lost.

Then what is left is to route from the queue to the http endpoint.
You can use Camel for this - in fact Camel is provided out of the box
in ActiveMQ.

A route could be as simple as this

  <from uri="acitvemq:queue:foo"/>
  <to uri=""/>

Then what you need as well is to have the redelivery support. For that
we can use transaction and let ActiveMQ handle the redelivery policy.
So the route needs to be configured for transaction, so we enable
transacted=true on the activemq endpoint.

  <from uri="acitvemq:queue:foo?transacted=true"/>
  <to uri=""/>

Then you need to setup Spring JMS transaction manager to use transaction.
Details here:

<bean id="jmsTransactionManager"
    <property name="connectionFactory" ref="jmsConnectionFactory" />

  <bean id="jmsConnectionFactory"
    <property name="brokerURL" value="vm://localhost"/>

And last you need to configure the redelivery policy of AcitveMQ to
your likening

As its ActiveMQ handling to "failed" message it will move it to a dead
letter queue inside activemq.
A little detail here:

> Regards,
> Leen Toelen

Claus Ibsen
Apache Camel Committer

Open Source Integration:

View raw message