I have a chain of 3 Spring JMS listeners A, B and C implemented on DefaultMessageListenerContainer
(DMLC). All DMLCs are deployed in one Java EE application.
A and C:
- have a transaction manager injected (the same one),
- they both receive and send messages in transacted sessions,开发者_运维技巧
- the same ConnectionFactory is injected in their DMLC (for receiving) and used for sending.
B:
- has no transaction manager,
- sends transactionless messages (
Connection.createSession(false, AUTO_ACKNOWLEDGE)
), - has a different, non-XA ConnectionFactory
Question: are transaction borders as illustrated below, and transactions 1 and 2 are separate (ML = message listener)?
| transaction 1 | ? | no transaction | ? | transaction 2 |
(broker) --> [ML A] --> (broker) --> [ML B] --> (broker) --> [ML C] |
Or maybe transaction 1 and 2 are one, and the fact that the "ML B" is non-transactional has no effect on continuity?
Additional question: what happens to the active transaction in the places marked "?", when the message is in the broker?
I don't know how to access transaction manager logs, so I cannot really verify that.
精彩评论