Skip to content

Commit 75dbf3a

Browse files
committed
Add routingkey for workflow exchange
1 parent d63fd00 commit 75dbf3a

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

OpenFlow/src/amqpwrapper.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,14 @@ export class amqpwrapper extends events.EventEmitter {
391391
const correlationId: string = msg.properties.correlationId;
392392
const replyTo: string = msg.properties.replyTo;
393393
const consumerTag: string = msg.fields.consumerTag;
394-
const routingkey: string = msg.fields.routingkey;
394+
const routingKey: string = msg.fields.routingKey;
395+
395396
const exchange: string = msg.fields.exchange;
396397
const options: QueueMessageOptions = {
397398
correlationId: correlationId,
398399
replyTo: replyTo,
399400
consumerTag: consumerTag,
400-
routingkey: routingkey,
401+
routingkey: routingKey,
401402
exchange: exchange
402403
}
403404
const data: string = msg.content.toString();

OpenFlow/src/public/Controllers.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,23 +1858,24 @@ export class FormCtrl extends entityCtrl<WorkflowInstance> {
18581858
if (!NoderedUtil.IsNullEmpty(this.localexchangequeue)) return;
18591859
const result = await NoderedUtil.RegisterExchange(WebSocketClient.instance, exchange, "direct",
18601860
"", async (msg: QueueMessage, ack: any) => {
1861-
// this.OnMessage(msg, ack);
18621861
console.log(msg);
18631862
ack();
1864-
// this.loadData();
1865-
this.model.payload = Object.assign(this.model.payload, msg.data.payload);
1866-
if (!NoderedUtil.IsNullEmpty(msg.data.payload.form)) {
1867-
if (msg.data.payload.form != this.model.form) {
1868-
const res = await NoderedUtil.Query("forms", { _id: msg.data.payload.form }, null, { _created: -1 }, 1, 0, null);
1869-
if (res.length > 0) {
1870-
this.model.form = msg.data.payload.form;
1871-
this.form = res[0];
1872-
} else {
1873-
console.error("Failed locating form " + msg.data.payload.form)
1863+
if (NoderedUtil.IsNullEmpty(msg.routingkey) || msg.routingkey == this.instanceid) {
1864+
// this.loadData();
1865+
this.model.payload = Object.assign(this.model.payload, msg.data.payload);
1866+
if (!NoderedUtil.IsNullEmpty(msg.data.payload.form)) {
1867+
if (msg.data.payload.form != this.model.form) {
1868+
const res = await NoderedUtil.Query("forms", { _id: msg.data.payload.form }, null, { _created: -1 }, 1, 0, null);
1869+
if (res.length > 0) {
1870+
this.model.form = msg.data.payload.form;
1871+
this.form = res[0];
1872+
} else {
1873+
console.error("Failed locating form " + msg.data.payload.form)
1874+
}
18741875
}
18751876
}
1877+
this.renderform();
18761878
}
1877-
this.renderform();
18781879
}, (msg) => {
18791880
// if (this != null && this.node != null) this.node.status({ fill: "red", shape: "dot", text: "Disconnected" });
18801881
// setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 500);

0 commit comments

Comments
 (0)