On Thu, Oct 27, 2011 at 12:05 AM, Calvert, Zach (Zach)** CTR **
<[email protected]> wrote:
> Just in case anyone cares, the problem was not the route, or the way I was 
> sending, but the configuration of the exchange.
>
> I didn't realize the route didn't define the InOut protocol, but you must set 
> exchange.setPattern(ExchangePattern.InOut);
>

Thanks for sharing your solution. Glad you got it working.


>
> Zach Calvert
>
>
> -----Original Message-----
> From: Calvert, Zach (Zach)** CTR ** [mailto:[email protected]]
> Sent: Wednesday, October 26, 2011 2:09 PM
> To: [email protected]
> Subject: Synchronous Message
>
> I'm using ServiceMix version 4.3.0 and simply trying to send a synchronous 
> message where I can get access to the MessageOut at the end.
>
> I have tried using the ProducerTemplate as well as the  
> camelContext.getEndpoint("myendpoint").createProducer().process(exchange);
> And nothing seems to fully fit my needs.
>
> Making the assumption I have a properly constructed exchange, endpoint, 
> camelContext, producerTemplate, I have the following examples and why they 
> don't work the way I need them to:
>
> Example 1:
>    producer.send(exchange);  // doesn't work because it doesn't block.  The 
> MessageOut doesn't contain the true message out body
> Example 2:
>    endpoint.createProducer().process(exchange);  // doesn't block
> Example 3:
>    producer.sendBodyAndHeaders(endpoint, "body", headersMap); // blocks, but 
> I can't get a handle to the MessageOut from the exchange, just the body - and 
> yes I have confirmed the body is correct so the endpoints really are behaving 
> the way I expect
> Example 4:
>    Future<Exchange> result = producer.asyncSend(endpoint, exchange);
>    Exchange idealResult = result.get();  // doesn't actually block and my 
> code is instant, Exchange isn't populated with MessageOut
>
> When I say these things aren't blocking, I'm reviewing the logs and making 
> sure that it really is not blocking.  Ideally, I have a producer.send message 
> which actually blocks and then I can get the various messages after the 
> processing is complete.  What am I missing?
>
>
>
>
> Thanks,
> Zach Calvert
>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to