You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "m.s." <da...@arcor.de> on 2009/08/27 08:25:10 UTC

Stop route as part of error handling

Hi,

I am wondering if it is possible to stop a route as part of the error
handling. E.g. if I have a transacted route from a JMS endpoint to an http
endpoint, the route should be stopped if the message cannot be delivered.
The message should be kept in the queue and redelivered if I manually start
the route when the endpoint is available again.

Thank for any hints on how this could be done.

M.S.
-- 
View this message in context: http://www.nabble.com/Stop-route-as-part-of-error-handling-tp25166908p25166908.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Stop route as part of error handling

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Aug 27, 2009 at 8:25 AM, m.s.<da...@arcor.de> wrote:
>
> Hi,
>
> I am wondering if it is possible to stop a route as part of the error
> handling. E.g. if I have a transacted route from a JMS endpoint to an http
> endpoint, the route should be stopped if the message cannot be delivered.
> The message should be kept in the queue and redelivered if I manually start
> the route when the endpoint is available again.
>
> Thank for any hints on how this could be done.
>

I do think we have in JIRA a ticket to let the route be triggered by
some predicate whether or not they are active or not.
We may get around this in the future so you can attach some sort of
predicate logic to your route that can control the route/consume
if its start or not.

Kinda like the onWhen we got in some other spots.



> M.S.
> --
> View this message in context: http://www.nabble.com/Stop-route-as-part-of-error-handling-tp25166908p25166908.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Stop route as part of error handling

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Aug 27, 2009 at 8:25 AM, m.s.<da...@arcor.de> wrote:
>
> Hi,
>
> I am wondering if it is possible to stop a route as part of the error
> handling. E.g. if I have a transacted route from a JMS endpoint to an http
> endpoint, the route should be stopped if the message cannot be delivered.
> The message should be kept in the queue and redelivered if I manually start
> the route when the endpoint is available again.
>
> Thank for any hints on how this could be done.
>

You can change tactic from using Event Driven Consumer EIP to a
Polling Consumer EIP
http://camel.apache.org/event-driven-consumer.html
http://camel.apache.org/polling-consumer.html

Then you can use a timer/scheduler to invoke a POJO which determines
if its "green or red" light.

If green you can just consume from the JMS endpoint one by one and
route the message.

See the timer based polling consumer example on the links above.


> M.S.
> --
> View this message in context: http://www.nabble.com/Stop-route-as-part-of-error-handling-tp25166908p25166908.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus