<p>I'm trying to replace some bespoke message queues with ActiveMQ, and I need to talk to them (a lot) from Perl.  ActiveMQ provides a Stomp interface and Perl has Net::Stomp, so this seems like it should be fine, but it's not.</p>

<p>Even if I send a BEGIN command over Stomp, messages sent with SEND are immediately published, and if I ABORT the transaction, nothing happens.</p>

<p>I can't find any clear answers suggesting that suggest it's not possible, that is is possible, or that there's a relevant bit of configuration.  Also, Stomp doesn't seem to be a great protocol for checking for error responses from the server.</p>

<p>Am I out of luck?</p>

[{'answer_id': 81006, 'author': 'James Strachan', 'author_id': 2068211, 'author_profile': 'https://Stackoverflow.com/users/2068211', 'pm_score': 2, 'selected': False, 'text': '<p>BTW the best place to ask Perl/ActiveMQ/Stomp questions is the <a href="http://activemq.apache.org/discussion-forums.html" rel="nofollow noreferrer">ActiveMQ user forum</a> as lots of Perl-Stomp folks hang out there.</p>\n\n<p>The trick with STOMP transactions is to make sure each message you send or each acknowledgement you make includes the transaction ID header. See the <a href="http://stomp.codehaus.org/Transaction+Handling" rel="nofollow noreferrer">transaction handling section of the STOMP protocol</a>. </p>\n\n<p>The reason for this is that with STOMP you could have many transactions taking place at the same time if your client is multi threaded - along with some non-transacted operations.</p>\n'}, {'answer_id': 93611, 'author': 'huguei', 'author_id': 17856, 'author_profile': 'https://Stackoverflow.com/users/17856', 'pm_score': 1, 'selected': False, 'text': '<p>Have a look at <a href="http://search.cpan.org/~huguei/Net-Stomp-Receipt-0.34/lib/Net/Stomp/Receipt.pm" rel="nofollow noreferrer">Net::Stomp::Receipt</a>. It\'s a subclass of Net::Stomp that implements "return receipts" from the Stomp protocol, and allow you to make sure the correct reception of your message, and abort the transaction otherwise.</p>\n'}, {'answer_id': 607425, 'author': 'Phillip Whelan', 'author_id': 25305, 'author_profile': 'https://Stackoverflow.com/users/25305', 'pm_score': 1, 'selected': False, 'text': '<p>You have to wrap the acknowledgements inside a transaction.</p>\n\n<p>In pseudocode (or pseudo STOMP) this would be:</p>\n\n<ul>\n<li>BEGIN [TRANSACTION-ID] -> send to server</li>\n<li>MESSAGE [MESSAGE-ID] (received) &lt;- received from server</li>\n<li>ACK [MESSAGE-ID] [TRANSACTION-ID] -> send to server</li>\n<li>COMMIT [TRANSACTION-ID] -> send to server</li>\n</ul>\n\n<p>I have already gotten this working with the PHP driver (patching the abort call to use the transaction ID when I pass in a frame object to acknowledge).</p>\n\n<p>Unfortunately, after redelivering four messages the client stops. At least this happens to me.</p>\n'}]
['https://Stackoverflow.com/questions/79482', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10478/']