You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by brenuart <be...@itma.lu> on 2013/11/09 10:47:43 UTC
Handling failures due to endpoint (temporary) unavailability
Suppose the following route:
from("activemq:input")
.to("mongodb:mymongo?database=...")
How should I handle the unavailability of the MongoDB?
Since it is a transient failure, I'd like to retry later when the db is back
online...
Should I tell CAMEL to retry "forever" (or at least long enough) until it
goes through ?
Or should I let Camel fail and tell ACTIVEMQ to retry ?
What is the solution usually applied for this kind of scenario ?
Thx
/Bertrand
--
View this message in context: http://camel.465427.n5.nabble.com/Handling-failures-due-to-endpoint-temporary-unavailability-tp5742920.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Handling failures due to endpoint (temporary) unavailability
Posted by Claus Ibsen <cl...@gmail.com>.
You can use Camel error handling to retry
http://camel.apache.org/error-handling-in-camel.html
But since your route input is from ActiveMQ you can also use
transactions, and let ActiveMQ do the redelivery, as that would
preserve the message in the broker, in case of a crash etc.
Camel error handler is in-memory so if Camel crash the message is lost.
For TX see
http://camel.apache.org/transactional-client.html
And also the docs at ActiveMQ how to configure its redelivery settings
and DLQ etc
And you can find some 3rd party blogs about error handling and TX at
http://camel.apache.org/articles.html
And also covered in the Camel in Action book chapter 5 and 9
On Sat, Nov 9, 2013 at 10:47 AM, brenuart <be...@itma.lu> wrote:
> Suppose the following route:
>
> from("activemq:input")
> .to("mongodb:mymongo?database=...")
>
> How should I handle the unavailability of the MongoDB?
> Since it is a transient failure, I'd like to retry later when the db is back
> online...
>
> Should I tell CAMEL to retry "forever" (or at least long enough) until it
> goes through ?
> Or should I let Camel fail and tell ACTIVEMQ to retry ?
> What is the solution usually applied for this kind of scenario ?
>
> Thx
>
> /Bertrand
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Handling-failures-due-to-endpoint-temporary-unavailability-tp5742920.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: Handling failures due to endpoint (temporary)
unavailability
Posted by Willem jiang <wi...@gmail.com>.
Hi,
I think you can take a look at DeadLetter DSL[1].
[1]http://camel.apache.org/dead-letter-channel.html
--
Willem Jiang
Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem
On Saturday, November 9, 2013 at 5:47 PM, brenuart wrote:
> Suppose the following route:
>
> from("activemq:input")
> .to("mongodb:mymongo?database=...")
>
> How should I handle the unavailability of the MongoDB?
> Since it is a transient failure, I'd like to retry later when the db is back
> online...
>
> Should I tell CAMEL to retry "forever" (or at least long enough) until it
> goes through ?
> Or should I let Camel fail and tell ACTIVEMQ to retry ?
> What is the solution usually applied for this kind of scenario ?
>
> Thx
>
> /Bertrand
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Handling-failures-due-to-endpoint-temporary-unavailability-tp5742920.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).