I am not sure I am following. For example the following page under "Flow of
an exchange through a route" it says "The OUT message from each step is used
as the IN message for the next step. If there is no OUT message then the IN
message is used instead".

Link: http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html

Also the javadoc for ProcessDefinition.transform (which I am using) says
"Adds a processor which sets the body on the OUT message"

Link:
https://camel.apache.org/maven/camel-2.15.0/camel-core/apidocs/org/apache/camel/model/ProcessorDefinition.html#transform(org.apache.camel.Expression)

So based on those two I read my flow as follows; the third line
[.transform(constant("AAA")] sets the body of the OUT message to "AAA". This
becomes the IN message for the next line [.inOnly("direct:BBB")]. 

Now, if inOnly means that the exchange does not have an OUT message (as per
what I wrote in first post) then shouldn't the IN message be sent to the
next step (based on the first link above)? i.e. - shouldn't the
[.log("${in.body}")] be equal to "AAA" which is the body of the IN message
passed to [.inOnly("direct:BBB")]?


DariusX wrote
> To clarify, your route flows from the initial consumer (jetty), to a
> remove step, then transform, then a "direct" route consisting of another
> transform, and then a log(). 
> 
> All through this sequence, you have an IN body going from step to step
> (sometimes being transformed, but still IN when it reaches the next step
> in the route). 
> The OUT would be the response that would be returned all the way back to
> whatever software entity made the initial request via to your jetty
> consumer. But, that OUT is not being set at any point. You could have a
> processor that sets the out.body
> 
> Another point to remember is that when you're logging, ${body} is a
> synonym for ${in.body}. You can use ${out.body} to log the body of the OUT
> (but that will be blank in your particular example).





--
View this message in context: 
http://camel.465427.n5.nabble.com/Can-t-understand-what-inOnly-is-doing-tp5787961p5787980.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to