camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: hanlding "poison" messages from IBM MQ Series
Date Wed, 07 Dec 2011 16:40:31 GMT
On Wed, Dec 7, 2011 at 4:39 PM, Mond Raymond <> wrote:
> I would like to clarify something regarding Camel exeption handling....
> From the IBM manuals:
> "The WebSphere® MQ queue manager keeps a record of the number of times that
> each message has been backed out. When this number reaches a configurable
> threshold value, the message consumer requeues the message to a named
> backout queue. If this re-queuing fails for any reason, the message is
> removed from the input queue and either requeued to the dead-letter queue,
> or discarded."
> So the question is whether this automagical message consumer is (or can be)
> mimicked in Camel?
> The advantage here is that I could treat AMQ and MQSeries in the same way
> for exception processing that is I could rely on the underlying JMS provider
> to deal with poison (badly formatted) messages.
> Is this is what's happening if I say:
> onException(MQException.class)
> .maximumRedeliveries(5)
> .to("mq:requeueName");
> Thanks in advance for your support.

No this has to be tracked by the MQ broker, when the client (JMS
consumer) does not acknowledge the JMS message, but issue a rollback

For example with camel-jms as a JMS consumer (eg from("jms:xxxx")) you
can use transacted acknowledge mode, which mean when any exception
occurs while processing the JMS message, then that exception is
propagated back, so the JMS consumer will issue a rollback.

Which gets detected by the JMS broker. And after X attempts the JMS
broker can move the message to its dead letter queue.

The code above with the onException is simulating this, as you let
Camel handle redeliveries, and after 5 failed attempts, you send the
message to a JMS destination. The JMS broker frankly do not know the
message failed, but all it see is that you acknowledge the message,
and send a new message to another JMS destination.

> Best regards
> Ray
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message