change prefetch settings

This commit is contained in:
Nimer Farahty 2025-04-20 21:55:29 +03:00
parent 11c7e44267
commit e43ab395e6

View File

@ -11,6 +11,7 @@ const rabbitUrl = process.env.RABBITMQ_URL || "amqp://localhost";
async function start() { async function start() {
const conn = await amqp.connect(rabbitUrl); const conn = await amqp.connect(rabbitUrl);
const channel = await conn.createChannel(); const channel = await conn.createChannel();
await channel.prefetch(1);
await channel.assertQueue(queueName); await channel.assertQueue(queueName);
console.log(`🎧 Listening for messages on "${queueName}"...`); console.log(`🎧 Listening for messages on "${queueName}"...`);