Announcement Announcement Module
No announcement yet.
Is a (internal) Channel transactional? Where does the transaction end? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is a (internal) Channel transactional? Where does the transaction end?


    i was studying the SI manual, but got no right answer to may questions. may you can give me a hint.

    let's assume i have a jms channel-adapter with ServiceActivator1 that is listening and processing messages. after this ServiceActivator1, it goes to channel1 and then to ServiceActivator2 then to a channel2 and than to ServiceActivator3. ServiceActivator3 writes the the data to the database.

    <int:channel id="channel1" >
    <int:queue capacity="10"/>

    <int:chain id="foobar" input-channel="jms" output-channel="channel1" >
    <int:filter ref="foobarFilter" method="accept" />
    <int:service-activator ref="acknowledge" method="acknowledge" />

    question 1:
    when is the transaction of the incoming jms finish? after ServiceActivator1 has send the message to the internal channel1? or when it is written to the database.

    Question 2:
    are these (internal) channels transactional. i mean, do i loose the message when the system crash? if yes, i guess i can avoid it buy using everywhere eg JMS channelAdapters. its this right?

    Question 3:
    just being curious, how is this done internally, this "in-memory" channel?

    thanks :-)

  • #2
    You indicated that the inbound jms channel adapter puts the inbound message to channel 1. If that is the case, the transaction from jms ends at channel 1. This is because you defined channel 1 with a queue. This means that the inbound jms channel adapter and the service activator that writes to the database will be operating in different threads. To have them operate in the same thread and thus the same transaction you would have to remove the queue from the channel 1 definition.


    • #3
      hi petem

      your statement sounds reasonable to me. is there any document that would confirm this? for reliable applications, this is a big issue. loosing a data is a killer in most applications!

      there are other element that i am not sure off, eg Router. with the router you could stay in the same thread or leave it, it depends on the implementation.

      it is also a performance issue: it would mean that if you have a long single row of connected elements (no <int:queue capacity="10"/>), let's say 30 processes, no parallel prossessing would happen. in other words, we must wait until the message leave the last process.


      • #4
        in the documentation i one parte about transactions
        27.2 Transaction Boundaries

        this gives you some information, but i am not 100% which component will start a new thread. is it only Pollable Channel or Executor Channel?