Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-2729

Enable transaction propagation for SEDA component

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 2.2.0
    • 3.0.0
    • None
    • None

    Description

      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!

      Attachments

        1. seda-camel.zip
          601 kB
          Sergio Bossa

        Activity

          People

            Unassigned Unassigned
            sbtourist Sergio Bossa
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: