Not sure if I am going down the wrong path, but I tried this too: (had
to fat finger this, so hopefully it compiles)

Endpoint endpoint = camelContext.getEndpoint("direct:workflow");
Exchange exchange = endpoint.createExchange(ExchangePattern.InOut);
exchange.getIn().setBody(obj);
CamelTemplate<Exchange> camelTemplate = new
CamelTemplate<Exchange>(camelContext, endpoint);
Exchange out = camelTemplate.send(exchange);


The problem becomes that even though I have a throwFault(...) in the
route specified, the CamelTemplate does not return this in the outgoing
Exchange. The exception field and the fault field are not populated. Am
I doing this wrong?

P.s. I am using Camel 1.4.0

Roshan

-----Original Message-----
From: James Strachan [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 09, 2008 11:09 AM
To: [email protected]
Subject: Re: Issue with the ProducerTemplate

2008/9/9 Punnoose, Roshan A. <[EMAIL PROTECTED]>:
> I tried searching on this problem, but couldn't come up with anything.
> Basically, i am using Spring and Camel Annotations to inject a 
> ProducerTemplate into a class and use the method requestBody to send 
> an object to a certain endpoint:
>
> producerTemplate.requestBody("direct:workflow", obj);
>
> Now if the route specified by "direct:workflow" throws an exception, i

> want it to bubble that exception up to the class invoking the 
> ProducerTemplate. Instead, the ProducerTemplate returns the same 
> Object
> (obj) that I used as a parameter. How can I get it to throw the 
> correct exception instead?

Ooh, this looks like a bug :).

I've raised an issue for this
https://issues.apache.org/activemq/browse/CAMEL-885
--
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Reply via email to