Here are our findings when upgrading beyond Camel 2.2

Here are some interesting observations during the testing of Camel 2.3.0
with synchronous "inOut()" in the route: 

When using "direct:", no matter what you do, processing will always be
synchronous since "direct" is just a continuation of the current thread 

When using "seda:", you can make the route go from synchronous to
asynchronous by using .inOnly("endpoint") instead of .to("endpoint"). See
example below 

When using "activemq:queue:", it behaves much alike seda, but if using
.to("endpoint") and then from("endpoint").inOnly, it throws an exception
because of the timeout 

Example: How to go from Sync to Async using either Seda or activeMQ. The
body() returned to the waiting Sync client is "B"  

// Syncrhonous route
from(activemq:queue1).inOut() 
.to(transformToA) 
.to(transformToB) 
.inOnly(activemq:queue2) <-- At this point Exchange body() contains "B" and
this is what is returned to sync client since we have reached end of inOut()
sync processing and are explicitly saying that we wish to continue further
asynchonously

from(activemq:queue2) <-- Adding .inOnly() here would throw an exception
with activemq. If using seda instead of activemq, no exception but in any
case you don't need it re-specify inOnly() here. 
.to(transformToC) 
.end() 

In our opinion, it's strange that adding inOnly() at beginning of the 2nd
route should throw an exception (with activeMQ). This may or may not be
resolved with newer versions of Camel. 

We would have expected that we could place the inOnly() at the beginning of
the 2nd route rather than at the end of the 1st route. At least, that is how
things were done in Camel 2.2 and before.

BRegards
Andrew
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-with-Splitter-in-Synchronous-routes-introduced-in-Camel-2-3-tp3210842p3260301.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to