-
1. Re: Does HornetQ solve this problem?
jbertram Jan 4, 2017 1:23 PM (in response to ccargill)Before I get to your question you should know that back in June of 2015 the HornetQ code-base was donated to the Apache ActiveMQ community. Since then no development has occurred on HornetQ itself. However, the HornetQ code-base lives on as the ActiveMQ Artemis broker. Over the last 18 months Artemis has evolved quite a bit to support many new features through 7 different releases (from 1.0.0 up until the latest 1.5.1). I answer your question under the assumption you'd be using the latest release of Artemis rather than HornetQ.
Artemis ties transactions to sessions which are in turn tied to connections so if your consumer starts a transaction and then explicitly closes its connection then the transaction on the server will be aborted. However, there is a kind of grace period for clients on unreliable connections such that the server will maintain its session data until the client can reconnect (assuming the client was configured to reconnect automatically). You can read more about this in the "Cleaning up Dead Connection Resources on the Server" section of the Artemis documentation.
I doubt if any general-purpose message broker would explicitly support the kind of functionality you're looking for where you can start a transaction, disconnect, and then reconnect later at some arbitrary time (or potentially never) to commit or rollback that transaction. Long running transactions are typically viewed as an anti-pattern as the longer they are around presumably the more resources/data will be involved in the transaction and the the more likely it is that something will fail and therefore undo all the work.