You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ndaniel <ni...@canal-plus.com> on 2015/06/26 11:35:42 UTC
activemq away catch exception
hi everyone,
I'm testing camel with activemq using servlet-rest-tomcat example (I'm not a
CAMEL expert).
I'm trying to response an error if I can't connect to activemq.
activemq is not start. I have the following line in my log :
11:22:43.003 [ActiveMQ Task-1] WARN o.a.a.t.f.FailoverTransport - Failed to
connect to [tcp://localhost:61616] after: 10 attempt(s) continuing to retry.
but I'm not able to catch this exception in my route.
here is my route :
rest("/actofmanagement").description("rest Service")
.consumes("application/json").produces("application/json")
.put("/updateEmail").description("UPDATE an
email").outType(ActsOfManagementResponse.class)
.route()
.doTry()
.process(fillQueueUpdateEmail) // insert data in the queue
.doCatch(CamelException.class, JMSException.class,
ConnectException.class,Exception.class, IOException.class,
InterruptedException.class )
.to("bean:ActsOfManagementWebService?method=responseErrorToClient(${body})").stop().end()
.to("bean:ActsOfManagementWebService?method=responseToClient(${body})")
.endRest()
I also tried a global onException, but nothing happening too. (empty result)
If someone has already tried this, let me know.
thanks all.
--
View this message in context: http://camel.465427.n5.nabble.com/activemq-away-catch-exception-tp5768595.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: activemq away catch exception
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Check the AMQ documentation as it has some sendAsync alwaysSendSync
options you can enable. Also you can configure the connection to not
try failover etc. and if so a maximum number etc.
On Fri, Jun 26, 2015 at 11:35 AM, ndaniel <ni...@canal-plus.com> wrote:
> hi everyone,
>
> I'm testing camel with activemq using servlet-rest-tomcat example (I'm not a
> CAMEL expert).
>
> I'm trying to response an error if I can't connect to activemq.
>
> activemq is not start. I have the following line in my log :
>
> 11:22:43.003 [ActiveMQ Task-1] WARN o.a.a.t.f.FailoverTransport - Failed to
> connect to [tcp://localhost:61616] after: 10 attempt(s) continuing to retry.
>
> but I'm not able to catch this exception in my route.
>
> here is my route :
>
> rest("/actofmanagement").description("rest Service")
> .consumes("application/json").produces("application/json")
>
> .put("/updateEmail").description("UPDATE an
> email").outType(ActsOfManagementResponse.class)
> .route()
> .doTry()
> .process(fillQueueUpdateEmail) // insert data in the queue
> .doCatch(CamelException.class, JMSException.class,
> ConnectException.class,Exception.class, IOException.class,
> InterruptedException.class )
>
> .to("bean:ActsOfManagementWebService?method=responseErrorToClient(${body})").stop().end()
>
> .to("bean:ActsOfManagementWebService?method=responseToClient(${body})")
> .endRest()
>
> I also tried a global onException, but nothing happening too. (empty result)
>
> If someone has already tried this, let me know.
>
> thanks all.
>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/activemq-away-catch-exception-tp5768595.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/