How to use amqplib.connect:
11 12 13 14 15 16 17 18 19 20
if (connection) { return connection; } try { connection = await amqp.connect(Configuration.get('RABBITMQ_URI')); connection.on('close', () => { logger.warning('RabbitMQ connection was closed.'); connection = undefined; });
17
67
18
See more examples