mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Fix multiple mqlight node subscriber issue
This commit is contained in:
parent
d515deece1
commit
cfb8ab7e92
@ -62,6 +62,7 @@ module.exports = function(RED) {
|
|||||||
var recvClient = node.serviceConfig.client;
|
var recvClient = node.serviceConfig.client;
|
||||||
recvClient.on("started", function() {
|
recvClient.on("started", function() {
|
||||||
recvClient.on("message", function(data, delivery) {
|
recvClient.on("message", function(data, delivery) {
|
||||||
|
if (node.topic === delivery.destination.topicPattern) {
|
||||||
var msg = {
|
var msg = {
|
||||||
topic: delivery.message.topic,
|
topic: delivery.message.topic,
|
||||||
payload: data,
|
payload: data,
|
||||||
@ -74,6 +75,7 @@ module.exports = function(RED) {
|
|||||||
msg.share = delivery.destination.share;
|
msg.share = delivery.destination.share;
|
||||||
}
|
}
|
||||||
node.send(msg);
|
node.send(msg);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
recvClient.on("error", function(err) {
|
recvClient.on("error", function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-mqlight",
|
"name" : "node-red-node-mqlight",
|
||||||
"version" : "0.0.6",
|
"version" : "0.0.7",
|
||||||
"description" : "A Node-RED node to send and receive message from IBM MQ Light",
|
"description" : "A Node-RED node to send and receive message from IBM MQ Light",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"mqlight" : "1.0.x"
|
"mqlight" : "1.0.x"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user