mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Bugfix: backward compatible node.topic has prio + Docs: added info about msg.topic in ACK node docs
This commit is contained in:
parent
04fee39a5a
commit
5fc7d873d9
@ -197,6 +197,7 @@
|
|||||||
<p>
|
<p>
|
||||||
The node allows for following inputs:
|
The node allows for following inputs:
|
||||||
<ul>
|
<ul>
|
||||||
|
<li><code>msg.topic</code>The topic to which the message should be acknowledged, if the <b>Destionation</b> field is set the msg.topic will be overwritten by this value</li>
|
||||||
<li><code>msg.messageId</code>: The id of the message to acknowledge</li>
|
<li><code>msg.messageId</code>: The id of the message to acknowledge</li>
|
||||||
<li><code>msg.transaction</code>: Optional transaction name</li>
|
<li><code>msg.transaction</code>: Optional transaction name</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -420,7 +420,7 @@ module.exports = function(RED) {
|
|||||||
setStatusDisconnected(node);
|
setStatusDisconnected(node);
|
||||||
|
|
||||||
node.on("input", function(msg, send, done) {
|
node.on("input", function(msg, send, done) {
|
||||||
const topic = msg.topic || node.topic;
|
const topic = node.topic || msg.topic;
|
||||||
if (topic.length > 0 && msg.payload) {
|
if (topic.length > 0 && msg.payload) {
|
||||||
try {
|
try {
|
||||||
msg.payload = JSON.stringify(msg.payload);
|
msg.payload = JSON.stringify(msg.payload);
|
||||||
@ -469,7 +469,7 @@ module.exports = function(RED) {
|
|||||||
setStatusDisconnected(node);
|
setStatusDisconnected(node);
|
||||||
|
|
||||||
node.on("input", function(msg, send, done) {
|
node.on("input", function(msg, send, done) {
|
||||||
const topic = msg.topic || node.topic;
|
const topic = node.topic || msg.topic;
|
||||||
if (topic.length > 0) {
|
if (topic.length > 0) {
|
||||||
node.serverConnection.ack(topic, msg.messageId, msg.transaction);
|
node.serverConnection.ack(topic, msg.messageId, msg.transaction);
|
||||||
} else if (!topic.length > 0) {
|
} else if (!topic.length > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user