You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dunnlow <du...@yahoo.com> on 2014/10/10 02:16:49 UTC

Handle first delivery failure differently then all following retries?

I'm using Camel 2.10.3 and Spring 3.1 with XML route configuration.   I have
a transacted route that is getting messages from several different sources
(and saving them to a database).  When there is an exception writing to the
database I want to send an alert (a web service) on the FIRST roll back.  In
other words, when the database is down, I want to keep retying the database,
but I don't want to send an alert for every retry.

For JMS I know I can look at the JMSRedelivered header, but for other
endpoints (ie file) I don't know how to check for a redelivered message.  As
I understand it, there isn't a way.

I'm considering pushing every non-JMS message that fails to the JMS queue
perhaps with a custom header.  If I do that, is there a way to add that
custom header to the message that is getting rolled back from my JMS queue
(the first time)?  Is there a better way to implement this?

Thanks -J





--
View this message in context: http://camel.465427.n5.nabble.com/Handle-first-delivery-failure-differently-then-all-following-retries-tp5757453.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Handle first delivery failure differently then all following retries?

Posted by John Taylor <jt...@gmail.com>.
dunnlow <du...@yahoo.com> writes:

> I'm using Camel 2.10.3 and Spring 3.1 with XML route configuration.   I have
> a transacted route that is getting messages from several different sources
> (and saving them to a database).  When there is an exception writing to the
> database I want to send an alert (a web service) on the FIRST roll back.  In
> other words, when the database is down, I want to keep retying the database,
> but I don't want to send an alert for every retry.
>
> For JMS I know I can look at the JMSRedelivered header, but for other
> endpoints (ie file) I don't know how to check for a redelivered message.  As
> I understand it, there isn't a way.
>
> I'm considering pushing every non-JMS message that fails to the JMS queue
> perhaps with a custom header.  If I do that, is there a way to add that
> custom header to the message that is getting rolled back from my JMS queue
> (the first time)?  Is there a better way to implement this?
>
> Thanks -J
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Handle-first-delivery-failure-differently-then-all-following-retries-tp5757453.html
> Sent from the Camel - Users mailing list archive at Nabble.com.