From 71737046fd1adf109f85d8402ad3aa49c1689fe8 Mon Sep 17 00:00:00 2001 From: Olivier Verhaegen <56387556+OlivierVerhaegen@users.noreply.github.com> Date: Mon, 17 Apr 2023 14:45:43 +0200 Subject: [PATCH] Bugfix: ack & better docs regardign ack --- io/stomp/18-stomp.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/io/stomp/18-stomp.js b/io/stomp/18-stomp.js index 2e338821..149f7900 100644 --- a/io/stomp/18-stomp.js +++ b/io/stomp/18-stomp.js @@ -334,6 +334,12 @@ module.exports = function(RED) { } } + /** + * Acknowledge (a) message(s) that was received from the specified queue. + * @param {String} queue The queue/topic to send an acknowledgement for + * @param {String} messageId ID of the message that was received from the server, which can be found in the reponse header as `message-id` + * @param {String} transaction Optional transaction name + */ node.ack = function(queue, messageId, transaction = undefined) { if (node.connected) { node.client.ack(messageId, node.subscriptionIds[queue], transaction); @@ -452,7 +458,7 @@ module.exports = function(RED) { setStatusDisconnected(node); node.on("input", function(msg, send, done) { - node.serverConnection.ack(msg.messageId, node.topic, msg.transaction); + node.serverConnection.ack(node.topic, msg.messageId, msg.transaction); done(); });