Willem, thanks for the idea. Here is a resulting issue I have run into. The
1st route takes a message from queue/batch/ready, it throws it into the seda
queue. It basically takes every message it can and stuffs it into the seda
queue as fast as it can. The second route does process them as I would
expect, but I cannot allow the first route to consume more than one at a
time. There are many more machines running this same route that will not
have a chance to get any messages.

<route>
   <from uri="q:queue:queue/batch/ready" />
   <transacted/>
   <to uri="bean:batchListener?method=init" />
   <to uri="seda:queue.process" />
</route>

<route>
   <from uri="seda:queue.process" />
   <to uri="bean:batchProcessor?method=process" />
</route>

So I came up with this. It fulfills the ability to consume only as many as
needed to process, but I don't think its handling the transaction boundary
well because of the "blockWhenFull" attribute. It appears that the blocking
on the first route is holding the transaction open until it is able to
commit the message to the seda queue.

<route>
   <from uri="q:queue:queue/batch/ready" />
   <transacted/>
   <to uri="bean:batchListener?method=init" />
   <to
uri="seda:queue.process?size=2&amp;blockWhenFull=true&amp;concurrentConsumers=1"
/>
</route>

<route>
   <from
uri="seda:queue.process?size=2&amp;blockWhenFull=true&amp;concurrentConsumers=1"
/>
   <to uri="bean:batchProcessor?method=process" />
</route>

I understand that the seda component is asynchronous, and that we are
essentially using it to clip off the transaction at the route boundary. But
that has its obvious downside of draining the actvemq queue in rapid fashion
and queuing them in seda. It is almost as if I need to us a vm component
instead of seda, but vm will participate in the transaction, which is the
original problem. I have looked into using a throttle on the first route,
but the data size being transferred is very inconsistent, and I cant rely on
the throttle to feed the second route appropriately.

I appreciate your help. If you could please let me know how I might be able
to use camel to achieve what I have mentioned above. 



--
View this message in context: 
http://camel.465427.n5.nabble.com/transactions-that-span-multiple-routes-tp5723735p5725194.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to