Affects Version/s: 2.2.0
Fix Version/s: 3.0.0
I was recently working on a pure SEDA prototype based on Camel and ActiveMQ, and the biggest problem I had was the lack of transaction propagation among stages/threads, due to the Spring transaction-per-thread model which Camel relies on.
Hence, it is currently impossible to commit/rollback transactions from a different stage than the one that initiated it.
So, I developed a patch to org.apache.camel.component.jms.JmsConfiguration class in order to use a custom org.springframework.jms.listener.AbstractMessageListenerContainer which enables external transaction management.
Then, I developed a Camel bean component to bind and propagate transactional resources among threads, and manually commit/rollback transactions.
I'm attaching a sample project containing and showcasing all this stuff: it reads from an ActiveMQ queue, does dummy processing, and puts on another queue.
In order to run:
$> mvn test
In order to run with an injected fault and do rollback:
$> mvn test -Pfault-test
WARN: requires a local ActiveMQ broker at tcp://localhost:61616
I'd like to gain some feedback and eventually talk about including such a features into Camel code base, which would require to:
1) Patch JmsConfiguration in order to allow injection of external AbstractMessageListenerContainer implementations.
2) Patch JmsConfiguration in order to avoid forcing to set the TransactionManager.
3) Somewhat enrich the Seda component to natively support transaction propagation.
Feel free to ask any question, and thanks for listening!