Skip to content

Commit d7701ed

Browse files
committed
Just bail out, on rabbitmq error
1 parent bbbad6b commit d7701ed

2 files changed

Lines changed: 16 additions & 13 deletions

File tree

OpenFlow/src/QueueClient.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,9 @@ export class QueueClient {
108108
} catch (error) {
109109
if (NoderedUtil.IsNullUndefinded(this.queue)) {
110110
Logger.instanse.warn("SendForProcessing queue is null, shutdown amqp connection");
111-
amqpwrapper.Instance().shutdown();
112-
amqpwrapper.Instance().connect(null);
111+
process.exit(406);
112+
// amqpwrapper.Instance().shutdown();
113+
// amqpwrapper.Instance().connect(null);
113114
} else {
114115
Logger.instanse.error(error);
115116
}

OpenFlow/src/amqpwrapper.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -256,17 +256,19 @@ export class amqpwrapper extends events.EventEmitter {
256256
}
257257
})
258258
this.channel.on('close', async () => {
259-
this.connected = false;
260-
try {
261-
if (this.conn != null) await this.conn.close();
262-
} catch (error) {
263-
}
264-
this.channel = null;
265-
if (this.timeout != null) {
266-
clearTimeout(this.timeout);
267-
this.timeout = null;
268-
}
269-
this.timeout = setTimeout(this.connect.bind(this), 1000);
259+
Logger.instanse.error("Exit, when we cannot create dead letter exchange and/or Openflow exchange");
260+
process.exit(406);
261+
// this.connected = false;
262+
// try {
263+
// if (this.conn != null) await this.conn.close();
264+
// } catch (error) {
265+
// }
266+
// this.channel = null;
267+
// if (this.timeout != null) {
268+
// clearTimeout(this.timeout);
269+
// this.timeout = null;
270+
// }
271+
// this.timeout = setTimeout(this.connect.bind(this), 1000);
270272
});
271273
} catch (error) {
272274
span?.recordException(error);

0 commit comments

Comments
 (0)