Hi there!
I am using node-red-contrib-queue-gate and am wondering how I can add trigger identifiers to the messages generated. For example I have a stream of data which is being queued. Then I have several triggers that are used to each release one item from the queue. In the resulting message from the queue I would like to add something like "trigger A" or "trigger B" to the message. This enables to know the source of the trigger.
Is there any way to achieve this directly with the queue node or do I need something else?
Thanks a lot!
JR
Example flow:
[
{
"id": "d94273488bc00d0c",
"type": "tab",
"label": "Flow 4",
"disabled": false,
"info": "",
"env": []
},
{
"id": "c54e919c.18d7f",
"type": "q-gate",
"z": "d94273488bc00d0c",
"name": "q-gate demo",
"controlTopic": "control",
"defaultState": "queueing",
"openCmd": "open",
"closeCmd": "close",
"toggleCmd": "toggle",
"queueCmd": "queue",
"defaultCmd": "default",
"triggerCmd": "trigger",
"flushCmd": "flush",
"resetCmd": "reset",
"peekCmd": "peek",
"dropCmd": "drop",
"statusCmd": "status",
"maxQueueLength": "0",
"keepNewest": false,
"qToggle": false,
"persist": false,
"x": 630,
"y": 360,
"wires": [
[
"d2740316.7035c"
]
]
},
{
"id": "c04db5ad.da76b8",
"type": "inject",
"z": "d94273488bc00d0c",
"name": "input",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "myData",
"payload": "",
"payloadType": "date",
"x": 350,
"y": 360,
"wires": [
[
"c54e919c.18d7f"
]
]
},
{
"id": "fb8c7d0f.40eec",
"type": "inject",
"z": "d94273488bc00d0c",
"name": "trigger A",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
},
{
"p": "source",
"v": "A",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "control",
"payload": "trigger",
"payloadType": "str",
"x": 360,
"y": 480,
"wires": [
[
"c54e919c.18d7f"
]
]
},
{
"id": "d2740316.7035c",
"type": "debug",
"z": "d94273488bc00d0c",
"name": "output",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 790,
"y": 360,
"wires": []
},
{
"id": "cab5863412e0d3eb",
"type": "inject",
"z": "d94273488bc00d0c",
"name": "trigger B",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
},
{
"p": "source",
"v": "B",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "control",
"payload": "trigger",
"payloadType": "str",
"x": 360,
"y": 540,
"wires": [
[
"c54e919c.18d7f"
]
]
}
]