Pratibha,

The route you're using is a pipeline -- it always sends the 'out' message from the previous hop along to the next one in the 'in' message, that's why you get the 'out' message from MyProviderService as the 'in' message in beanProviderService2.

If you want to get both of them, you need to write add intercept to your route:
       from("direct:a")
                 .intercept(new DelegateProcessor() {
public void process(Exchange exchange) throws Exception {
                         proceed(exchange);
System.out.println(exchange.getIn() + " -> " + exchange.getOut());
                     };
                 }).to("bean:ServiceBean?methodName=heavyLiftingLogic")

Here the delegate processor will first proceed with the Exchange, invoking the "bean:ServiceBean", and will regain control afterwards so it can print out both the in and out message. You can use this to start a new Exchange with another endpoint, where you can send along both the in and out value -- just pack them together somehow and put them in your new Exchange's 'in' message.

Regards,

Gert

pratibhaG wrote:
I am using camel for routing a message like this:
from("jbi:service:http://servicemix.in2m.com/samples/http/jmsConsumer1";)
.to("jbi:service:http://servicemix.in2m.com/samples/http/MyProviderService?mep=in-out";);

I want to get in as well as out message from MyProviderService at a time .
Is it possible to get it.?

I tried this:
from("jbi:service:http://servicemix.in2m.com/samples/http/jmsConsumer1";)
.to("jbi:service:http://servicemix.in2m.com/samples/http/MyProviderService?mep=in-out";) .to("jbi:service:http://servicemix.in2m.com/samples/http/beanProviderService2?mep=in-only";);
        
I tried to get messages in beanProviderService2 but I am not able to get the
in message to MyProviderService I only get out message. How can I get both?

Please help.

Pratibha


Reply via email to