You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Mond Raymond <mo...@gmail.com> on 2011/12/07 16:39:01 UTC

hanlding "poison" messages from IBM MQ Series

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.

Best regards

Ray

--
View this message in context: http://camel.465427.n5.nabble.com/hanlding-poison-messages-from-IBM-MQ-Series-tp5056027p5056027.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: hanlding "poison" messages from IBM MQ Series

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Dec 7, 2011 at 4:39 PM, Mond Raymond <mo...@gmail.com> 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
instead.

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: http://camel.465427.n5.nabble.com/hanlding-poison-messages-from-IBM-MQ-Series-tp5056027p5056027.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/