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