You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Bernard Ligny <be...@gmail.com> on 2017/04/26 13:33:21 UTC

Body lost with intra-context calls using direct-vm component

I am busy with the refactoring of a mono-context Camel application into a
multi-context one.
In order to allow cross-contexts direct calls (and to avoid the replacement
of numerous existing "direct:" uris), I did the following (that is to say:
"direct" alias now uses DirectVmComponent instead of DirectComponent)

	
	
This is working fine...
However, by doing this, I noticed this (very very strange) behaviour.

When calling (with "direct" alias but using direct-vm component) a sub-route
of the SAME context, the exchange body is lost when exiting the sub-route.

*Example*:

	
	
When run, the stdout is:



=> we can see the body is populated when exiting the sub-route, and suddenly
becomes empty when returned back to the calling route.

NB: Yes stream caching is enabled (to read body many times) + I did a stream
to string conversion (convertBodyToString)

As soon as I comment the "@Produces" section (to use DirectComponent and no
more DirectVmComponent),
the route behave as expected.



Am I doing something wrong, or should I create a JIRA issue about it ?



--
View this message in context: http://camel.465427.n5.nabble.com/Body-lost-with-intra-context-calls-using-direct-vm-component-tp5798327.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Body lost with intra-context calls using direct-vm component

Posted by Bernard Ligny <be...@gmail.com>.
Surprisingly, to make it work, I had to force a In&Out pattern on the To uri
!



I guess (not checked in the Camel source) that the Exchange *copy* that was
sent to the direct-vm endpoint, inherits by default from the same
ExchangePattern as the original...which (in my case) was a InOnly one (>JMS
consumer) ??







--
View this message in context: http://camel.465427.n5.nabble.com/Body-lost-with-intra-context-calls-using-direct-vm-component-tp5798327p5798337.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Body lost with intra-context calls using direct-vm component

Posted by Bernard Ligny <be...@gmail.com>.
Issue created in JIRA:
https://issues.apache.org/jira/browse/CAMEL-11217




--
View this message in context: http://camel.465427.n5.nabble.com/Body-lost-with-intra-context-calls-using-direct-vm-component-tp5798327p5798476.html
Sent from the Camel - Users mailing list archive at Nabble.com.