javascript - RabbitMQ one channel multiple consumers -


i have node.js app, has rabbitmq consumer. consumer craeted this:

amqp.connect(rabbitmq_url, function (err, conn) {     channel = conn.createchannel(function (err, ch) {         var q = 'example_queue';         ch.prefetch(1, true);         ch.assertqueue(q, { durable: true });          ch.consume(q, (() => {             // logic         }, {noack: false})     }) }) 

by scaling app, multiple consumers active. want have 1 channel, 1 consumer active (only 1 unacked message channel). ch.prefetch(1, true) should that, per channel. how can connect consumers under 1 channel? , if channel doesnt exists, created?

thanks


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -