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

Reply via email to