Skip to content

Instantly share code, notes, and snippets.

@mrsid96
Last active July 7, 2020 18:32
Show Gist options
  • Save mrsid96/5a58b47a7bd31b0290e8836207790112 to your computer and use it in GitHub Desktop.
Save mrsid96/5a58b47a7bd31b0290e8836207790112 to your computer and use it in GitHub Desktop.
let workOnChannel = async (channel) => {
//The channel here is a regular amqplib `ConfirmChannel`.
let exchange = "myFavExchangeName";
await channel.assertExchange(exchange, 'fanout', {
durable: false
});
let { queue } = await channel.assertQueue('', {
exclusive: true,
autoDelete: true
});
console.log("[*] Waiting for messages in %s. To exit press CTRL+C", queue);
channel.bindQueue(queue, exchange, '');
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment