一种方法是对每个源使用不同的
msg.topic
[“id”:“7f9b1fbb.58ff”,“type”:“join”,“z”:“f9a2eec9.c2e26”,“name”:“”,“mode”:“custom”,“build”:“object”,“property”:“payload”,“property type”:“msg”,“key”:“topic”,“joiner”:“”,“joiner type”:“str”,“accumate”:“true”,“timeout”:“”,“count”:“3”,“reducceright”:“false,”“reduceexp”:“”,“reduceinit y”:“”,“reduceinitype”:“”,“reduceixtup”:“”,“x”:770,“ires“:[”42ac1f9e.eac62”]125,“id”:“42ac1f9e.eac62”,“type”:“debug”,“z”:“f9a2eec9.c2e26”,“name”:“”,“activ”:真,“tosidbar”:真,“控制台”:假,“tostatus”:假,“tostatus”:假,”完整““:”真,“x”:930,“y”:2040,”Wire““[”””””””””,,,,\,,,“id”:”id““],\123,,/:value“,”method“:”get“,”upload“:false”,swaggerdoc“:”“,,X“:180,”Y“:2020,”wires“:[“8CA164F9.828898”],“id”:“51684D03.091EAA4”,“type”:“http-in”,“z”:“F922EEC9.C2E26”,“name”:“源2”,“url“:”/sourc2/:value”,“方法”:“获取”,“上传”:false,“Y“:2020”,X“:180,”Y“:20660,”wires“:[[[“2B81DC1.351562.351562””]]\125,,,;,”“id”:“id”:“5168444A1684D03.0934“type”:“http-in”,“z”:“f9a2eec9.c2e26”,“name”:“source 3”,“url”:“/source”3/:value,“方法”:“获取”,“上传”:false,“SwaggerDoc”:“”,,X“:180,”Y“:2100,”wires“:[”C7DA5F3A.95B71”],“id”:“9A85C694.2A37A8.2A37A8”,“类型”:“http响应”,“Z”:“F922EEC9.c2E26.c2E26.c2E26”,“名称”:“”,“状态码”:“204”,“头”:\\,,,,,,,,,,,,,,,,,,,'X“:780”,X“:780,Y“:780”,,Y“:180”,Y“z”:“f9a2eec9.c2e26”,“name”:“设置有效负载值”,“rules”:[“t”:“set”P“,'P”:“有效载荷”,“p t”:“msg”,“to”:“req.params.value”,“to t”:“msg”;],“action”:”,“prope“:”,,“from”:“,,”to“:”,,“Reg“:假”,X“:5700,Y“:20660,”wires““[[”985C694.2A337A8”,7F991bb1fbb.58ff”],,”id“:”8CA64F9.82889.828898.828898”,“type”:“Chang”,“z”:“F922E92EC9.C2E26.C2E26.C2E26”,“name”:“to”:“to”:“req.req.“set”,“p”:“topic”,“p t”:“msg”,“to”:“source1”,“to t”:“str”],“action”:“”,'property“:”,,'from“:”,'to“:”,'reg“:false,x“:350”,y“:2020,”wires“[”2A00579A6.612c66”],“id”:“2B81DC1.351562”,“type”:“change”,“z”:“F92EEC9.C2E26”,“name”:“set to p 2”,“ru规则”:[,”t““:”设置,p“:”主题,p t“:”msg”,“to”:“sourc2”,“to t”:“str”;,,,actio“:”,action“:”,'prope“:”,“prope“:”,,,'prope“:”,,,,,,“从“:”“”,“Reg”:假,“X”:350,“Y”:2060,“Wires”:[“2A0579A6.612C66”]},“id”:“c7da5f3a.95b71”,“type”:“change”,“z”:“f9a2eec9.c2e26”,“name”:“set topic 3”,“rules”:[“t”:“set”,“p”:“topic”,“p t”:“msg”,“to”:“source3”,“to t”:“str”],“action”:“”,“property”:“”,“from”:“”,“to”:“”,“reg”:false,”x“:350”,“y”:2100”,“wires”:[“2a0579a6.612c66”]]
< /代码>
如注释中所述,您需要从所有以http-in开始的流中返回somethingnodes…通常,我喜欢使用HTTPPOST端点(用于接收输入值)并返回状态代码204(无内容),让调用者知道该值已被接受。由于原始流使用GET节点,因此我参数化了URL(例如/source1/:value)并使用change节点将值复制到有效负载。您的里程可能会有所不同…
请注意,我将“消息部分数”设置为3,这意味着您将不会从joinnode获得输出,直到它接收到3differenttopic值。之后,每个输入消息将输出最新的组合消息对象(因为“每个后续消息”复选框)。通过调整这两个选项,您可以获得所需的任何行为。
在主题上键入一个对象:

[{"id":"7f9b1fbb.58ff","type":"join","z":"f9a2eec9.c2e26","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":770,"y":2040,"wires":[["42ac1f9e.eac62"]]},{"id":"42ac1f9e.eac62","type":"debug","z":"f9a2eec9.c2e26","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":930,"y":2040,"wires":[]},{"id":"37be742c.72a96c","type":"http in","z":"f9a2eec9.c2e26","name":"source 1","url":"/source1/:value","method":"get","upload":false,"swaggerDoc":"","x":180,"y":2020,"wires":[["8ca164f9.828898"]]},{"id":"51684d03.091ea4","type":"http in","z":"f9a2eec9.c2e26","name":"source 2","url":"/source2/:value","method":"get","upload":false,"swaggerDoc":"","x":180,"y":2060,"wires":[["2bb81dc1.351562"]]},{"id":"1a7ad806.dbb598","type":"http in","z":"f9a2eec9.c2e26","name":"source 3","url":"/source3/:value","method":"get","upload":false,"swaggerDoc":"","x":180,"y":2100,"wires":[["c7da5f3a.95b71"]]},{"id":"9a85c694.2a37a8","type":"http response","z":"f9a2eec9.c2e26","name":"","statusCode":"204","headers":{},"x":780,"y":2080,"wires":[]},{"id":"2a0579a6.612c66","type":"change","z":"f9a2eec9.c2e26","name":"set payload value","rules":[{"t":"set","p":"payload","pt":"msg","to":"req.params.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":2060,"wires":[["9a85c694.2a37a8","7f9b1fbb.58ff"]]},{"id":"8ca164f9.828898","type":"change","z":"f9a2eec9.c2e26","name":"set topic 1","rules":[{"t":"set","p":"topic","pt":"msg","to":"source1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":2020,"wires":[["2a0579a6.612c66"]]},{"id":"2bb81dc1.351562","type":"change","z":"f9a2eec9.c2e26","name":"set topic 2","rules":[{"t":"set","p":"topic","pt":"msg","to":"source2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":2060,"wires":[["2a0579a6.612c66"]]},{"id":"c7da5f3a.95b71","type":"change","z":"f9a2eec9.c2e26","name":"set topic 3","rules":[{"t":"set","p":"topic","pt":"msg","to":"source3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":2100,"wires":[["2a0579a6.612c66"]]}]
如评论中所述,您需要返回某物从你所有的流程开始http in
节点…通常,我喜欢使用HTTPPOST端点(用于接收输入值)并返回状态代码204(无内容),让调用者知道该值已被接受。由于原始流使用get节点,因此我参数化了URL(例如/source1/:value
)并使用change
将值复制到有效负载的节点。您的里程可能会有所不同…
请注意,我将“消息部分数”设置为3,这意味着您将无法从参加
节点,直到它收到3不同的主题值。之后,每个输入消息将输出最新的组合消息对象(因为“每个后续消息”复选框)。通过调整这两个选项,您可以获得所需的任何行为。