Skip to content

Commit 078a20c

Browse files
committed
Add error output for timeouts and errors
1 parent cb7a92a commit 078a20c

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

OpenFlowNodeRED/src/nodered/nodes/amqp.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
},
6262
inputs: 0,
6363
outputs: 1,
64+
outputLabels: ["completed", "error"],
6465
icon: "bridge.png",
6566
label: function () {
6667
return this.name || "amqp consumer";
@@ -111,7 +112,8 @@
111112
config: { value: "", type: "amqp-connection", required: false }
112113
},
113114
inputs: 1,
114-
outputs: 1,
115+
outputs: 2,
116+
outputLabels: ["completed", "error"],
115117
icon: "bridge.png",
116118
label: function () {
117119
return this.name || "amqp publisher";

OpenFlowNodeRED/src/nodered/nodes/amqp_nodes.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,12 @@ export class amqp_publisher_node {
215215
var data = msg.data;
216216
result.payload = data.payload;
217217
result.jwt = data.jwt;
218-
this.node.send(result);
218+
if (data.command == "timeout") {
219+
result.error = "Message timed out, message was not picked up in a timely fashion";
220+
this.node.send([null, result]);
221+
} else {
222+
this.node.send(result);
223+
}
219224
ack();
220225
} catch (error) {
221226
NoderedUtil.HandleError(this, error);

0 commit comments

Comments
 (0)