On Mon, Nov 26, 2012 at 9:17 AM, maxence.dewil <[email protected]> wrote:
> Hi,
>
> I need some clarification for inOnly(String uri): the documentation states
> ''Notice the existing MEP is restored after the message has been sent to the
> given endpoint."
>
> However with the route below, I loose my original 'Input' object:
>
> from("direct:myRoute")
> .process(new Processor() {
>     public void process(Exchange exchange) throws Exception {
>         exchange.getIn().setBody(new Input()));
>     }
> })
> .inOnly("direct:eventRoute")
>

This is because you use the direct component which is a synchronous
method call.
And in your eventRoute you may alter the message, which gets reflected.

> And if I change the route to this:
>
> from("direct:myRoute")
> .process(new Processor() {
>     public void process(Exchange exchange) throws Exception {
>         exchange.getIn().setBody(new Input()));
>     }
> })
> .inOnly("seda:eventRoute")
>
> Then my 'Input' object is available in exchange.getOut().getBody()
>

As you call a async component, seda. Then it copies a message to the
seda queue, and continues processing.

See
http://camel.apache.org/event-message.html
http://camel.apache.org/direct
http://camel.apache.org/seda


> Thank
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/inOnly-and-original-MEP-tp5723219.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to