You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Eugenio Perrotta Neto <eu...@gmail.com> on 2012/12/16 21:53:48 UTC

execute an action on exception and use redeçivery Policy

Hello. Its the first time i'm writing on this forum. I read everyday to solve
my question and always was very useful for me. But know i'm facing a biiiiig
problem. I will try to explain:


I want to create a route that listens to a queue of ActiveMQ.

from("activwmq:queue:myQueue");

I want each message, only one processing is performed

from("activwmq:queue:myQueue")
.processRef("myProcessor");

in this processor, for any exception throwed i want to redelivery this
message to the route for x times and with y miliseconds of delay:

from("activmq:queue:myQueue")
.onException(Exception.class).maximumRedeliveries(x).redeliveryDelay(y).end()
.processRef("myProcessor");

So far so good.

my problem is:I would like to run a processor when an exception was throwed
and not when it was done redelivery.
 
Run a processor on redeçlivery is very easy. Just use the onRedelivery().
Run a processor when the exception was throwed is easy to. Just use doTry
and tocatch.


But execute when a execute a processor on catch the message is not
redelivery. 

can someone help me? I'm sorry for my English. I am from Brazil

thanks 





--
View this message in context: http://camel.465427.n5.nabble.com/execute-an-action-on-exception-and-use-redecivery-Policy-tp5724183.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: execute an action on exception and use redeçivery Policy

Posted by Eugenio Perrotta Neto <eu...@gmail.com>.
I used,  but I could not rethrow the exception to be catched or treated by
an onexception clause!


On Sun, Dec 16, 2012 at 11:42 PM, Willem.Jiang [via Camel] <
ml-node+s465427n5724185h65@n5.nabble.com> wrote:

> Hi,
>
> Did you try to use the "try … catch" DSL[1]
>
> [1]http://camel.apache.org/try-catch-finally.html
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | 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 Monday, December 17, 2012 at 4:53 AM, Eugenio Perrotta Neto wrote:
>
> > Hello. Its the first time i'm writing on this forum. I read everyday to
> solve
> > my question and always was very useful for me. But know i'm facing a
> biiiiig
> > problem. I will try to explain:
> >
> >
> > I want to create a route that listens to a queue of ActiveMQ.
> >
> > from("activwmq:queue:myQueue");
> >
> > I want each message, only one processing is performed
> >
> > from("activwmq:queue:myQueue")
> > .processRef("myProcessor");
> >
> > in this processor, for any exception throwed i want to redelivery this
> > message to the route for x times and with y miliseconds of delay:
> >
> > from("activmq:queue:myQueue")
> >
> .onException(Exception.class).maximumRedeliveries(x).redeliveryDelay(y).end()
>
> > .processRef("myProcessor");
> >
> > So far so good.
> >
> > my problem is:I would like to run a processor when an exception was
> throwed
> > and not when it was done redelivery.
> >
> > Run a processor on redeçlivery is very easy. Just use the
> onRedelivery().
> > Run a processor when the exception was throwed is easy to. Just use
> doTry
> > and tocatch.
> >
> >
> > But execute when a execute a processor on catch the message is not
> > redelivery.
> >
> > can someone help me? I'm sorry for my English. I am from Brazil
> >
> > thanks
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/execute-an-action-on-exception-and-use-redecivery-Policy-tp5724183.html
> > Sent from the Camel - Users mailing list archive at Nabble.com (
> http://Nabble.com).
>
>
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/execute-an-action-on-exception-and-use-redecivery-Policy-tp5724183p5724185.html
>  To unsubscribe from execute an action on exception and use redeçivery
> Policy, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5724183&code=ZXVnZW5pby5wZXJyb3R0YW5ldG9AZ21haWwuY29tfDU3MjQxODN8LTE5OTU0NzIwODY=>
> .
> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
Eugenio Perrotta Neto
Tel: (27) 9913-8080




--
View this message in context: http://camel.465427.n5.nabble.com/execute-an-action-on-exception-and-use-redecivery-Policy-tp5724183p5724230.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: execute an action on exception and useredeçivery Policy

Posted by Willem jiang <wi...@gmail.com>.
Hi,

Did you try to use the "try … catch" DSL[1]

[1]http://camel.apache.org/try-catch-finally.html  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | 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 Monday, December 17, 2012 at 4:53 AM, Eugenio Perrotta Neto wrote:

> Hello. Its the first time i'm writing on this forum. I read everyday to solve
> my question and always was very useful for me. But know i'm facing a biiiiig
> problem. I will try to explain:
>  
>  
> I want to create a route that listens to a queue of ActiveMQ.
>  
> from("activwmq:queue:myQueue");
>  
> I want each message, only one processing is performed
>  
> from("activwmq:queue:myQueue")
> .processRef("myProcessor");
>  
> in this processor, for any exception throwed i want to redelivery this
> message to the route for x times and with y miliseconds of delay:
>  
> from("activmq:queue:myQueue")
> .onException(Exception.class).maximumRedeliveries(x).redeliveryDelay(y).end()
> .processRef("myProcessor");
>  
> So far so good.
>  
> my problem is:I would like to run a processor when an exception was throwed
> and not when it was done redelivery.
>  
> Run a processor on redeçlivery is very easy. Just use the onRedelivery().
> Run a processor when the exception was throwed is easy to. Just use doTry
> and tocatch.
>  
>  
> But execute when a execute a processor on catch the message is not
> redelivery.  
>  
> can someone help me? I'm sorry for my English. I am from Brazil
>  
> thanks  
>  
>  
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/execute-an-action-on-exception-and-use-redecivery-Policy-tp5724183.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).