mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Bugfix: ack & better docs regardign ack
This commit is contained in:
parent
564944ebca
commit
71737046fd
@ -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) {
|
node.ack = function(queue, messageId, transaction = undefined) {
|
||||||
if (node.connected) {
|
if (node.connected) {
|
||||||
node.client.ack(messageId, node.subscriptionIds[queue], transaction);
|
node.client.ack(messageId, node.subscriptionIds[queue], transaction);
|
||||||
@ -452,7 +458,7 @@ module.exports = function(RED) {
|
|||||||
setStatusDisconnected(node);
|
setStatusDisconnected(node);
|
||||||
|
|
||||||
node.on("input", function(msg, send, done) {
|
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();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user