You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by loganathan <lo...@gmail.com> on 2013/06/24 12:51:19 UTC

Problem in getting failure end point details in camel

I have route like this 

onException(Exception.class).process(new MyProcessor());

if (true) {
			from("route")
				.routeId("key")
				.transacted()
				.to(route1);
		} 
from("route1") 
                        .transacted() 
                        .routeId("name1") 
                        .split((body())) 
                        .process(new exampleprocessor()) 
                        .process(new exampleRecipientListProcessor()) 
                       
.recipientList(header(ConstantS.EXAMPLE_RECIPIENTS_KEY)) 

Inside the exampleRecipientListProcessor class i am setting recipient list
in exchange object header like
exchange.getIn().setHeader(constants.key, recipientqueues);

Let's suppose recipientqueues contains two queue names
(jms:queue:example,jms:invalidqueue) in that first queuename is valid and
second is invalid. 

when i send data by using producertemplate to route1 its throwing an
exception in recipient list as "No endpoint is configured for invalid
jobqueue" and exception is caught in onException myprocessor class in that
even if i am using 
exchange.getProperty(exchange.FAILURE_ENDPOINT, String.class) to get the
failure endpoint its not showing the invalid queuename(jms:invalidqueue) as
failure endpoint.its showing "route1" as failure endpoint.

Note:i am throwing camel exception in all .process class.

Anyone help for me this issue would be highly appreciated. 









--
View this message in context: http://camel.465427.n5.nabble.com/Problem-in-getting-failure-end-point-details-in-camel-tp5734652.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Problem in getting failure end point details in camel

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

exchange.getProperty(exchange.FAILURE_ENDPOINT, String.class)

Is like chicken-and-egg. This property is the last endpoint used that failed.
What you have is NOT an endpoint but an invalid uri for an endpoint.
So NO endpoints is created and in use.
You would need to grab the uri from the exception message that
recipient list throws.

For example I assume a ResolveEndpointFailedException is thrown. That
exception has a getUri method you can use to get that invalid uri.

On Mon, Jun 24, 2013 at 12:51 PM, loganathan <lo...@gmail.com> wrote:
> I have route like this
>
> onException(Exception.class).process(new MyProcessor());
>
> if (true) {
>                         from("route")
>                                 .routeId("key")
>                                 .transacted()
>                                 .to(route1);
>                 }
> from("route1")
>                         .transacted()
>                         .routeId("name1")
>                         .split((body()))
>                         .process(new exampleprocessor())
>                         .process(new exampleRecipientListProcessor())
>
> .recipientList(header(ConstantS.EXAMPLE_RECIPIENTS_KEY))
>
> Inside the exampleRecipientListProcessor class i am setting recipient list
> in exchange object header like
> exchange.getIn().setHeader(constants.key, recipientqueues);
>
> Let's suppose recipientqueues contains two queue names
> (jms:queue:example,jms:invalidqueue) in that first queuename is valid and
> second is invalid.
>
> when i send data by using producertemplate to route1 its throwing an
> exception in recipient list as "No endpoint is configured for invalid
> jobqueue" and exception is caught in onException myprocessor class in that
> even if i am using
> exchange.getProperty(exchange.FAILURE_ENDPOINT, String.class) to get the
> failure endpoint its not showing the invalid queuename(jms:invalidqueue) as
> failure endpoint.its showing "route1" as failure endpoint.
>
> Note:i am throwing camel exception in all .process class.
>
> Anyone help for me this issue would be highly appreciated.
>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Problem-in-getting-failure-end-point-details-in-camel-tp5734652.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen