Reprint please indicate the source: http://blog.csdn.net/l1028386804/article/details/75246853
ACTIVEMQ has support for both transactions, JMS transactions-the commit ()/rollback () methods on a session (which are like doing commit ()/Rollbac K () on a JDBC connection) XA Transactions-where The xasession acts as a XAResource by communicating and the message Br Oker, rather like a JDBC Connection takes place in an XA transaction through communicating with the database.
In a session that supports transactions, producer sends messages with a transaction ID in the message. Broker receives the message to determine if there is a transaction ID, and if so, keep it in the transaction store and wait for a commit or rollback. So ACTIVEMQ transactions are for broker rather than producer, and whether the session is Commit,broker will receive a message.
If the producer Send mode chooses persistent, the message expires and enters the death queue. Before the message enters the death queue, ACTIVEMQ deletes the transaction ID in the message so that the expired message is not in the transaction, is not saved in the transaction store, and goes directly to the death queue. The exact deletion of the transaction ID is in the
Org.apache.activemq.util.BrokerSupport Doresend, the transaction ID is saved in Originaltransactionid, and the transaction ID is deleted