I'm not sure on point 3 either and the tests didn't appear that way.  If
you look at the Unit test I posted earlier on that thread or even
copy/paste it into a test class and run it you'll notice that the sub-route
invocation behavior changes depending on whether the initial invocation of
the very first endpoint is fire and forget or request/reply.  On a
request/reply (requestBody) the sub-route even with SEDA is invoked before
the parent route completes.  So the mutation of the value there appears in
the final log statement of the parent route.  On a fire and forget
(sendBody) then the parent route will complete with the same value you sent
in and you'll see it log that very same value.  Then the sub-route executes.

The exchange Id changes when going from one route to another but I don't
think that implies a deep clone and I'd have to check it. So essentially
when you pass the Exchange to the sub-route, you are passing a big hashmap
with headers, properties and an In Message and a null Out Message.  So when
you change the value of the body in the sub-route  in a request/reply
you'll see it show up in the final log statement of the parent route.

Since I almost never uses Processors or directly manipulate Exchanges there
are likely a number of folks who can chime in and give you a better
explanation.

On Tue, Sep 27, 2016 at 5:22 AM, sim085 <sim...@hotmail.com> wrote:

>
> Just want to highlight that I have my reservations on point 3.
>
> From what I can see the ExchangePattern parameter doesn't determine
> anything. The same applies for calling something using inOut or inOnly.
>
> Again from what I can see from the examples I have tried out, what
> determines if the parent route will wait or not for the sub-route to
> complete, or if the message used by the parent is the IN passed to the
> sub-route or the OUT of the sub-route ALL DEPENDS on if the sub-route, i.e.
> - if the sub route care less about the Exchange Pattern with which it has
> been called or not.
>
> I do not know if anyone can share an example where this is not so?
>
>
> DariusX wrote
> > 3. The MEP used for the "sub-route" determines whether the "parent" route
> > will wait for the "sub-route" and use the out-message of that sub-route
> as
> > the in-message to its next step.
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/Can-t-understand-what-inOnly-is-doing-tp5787961p5788103.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to