Hello everyone. I'm using Queues to process WhatsApp Business API Webhooks, so, when I receive the b

Hello everyone. I'm using Queues to process WhatsApp Business API Webhooks, so, when I receive the batch, I can ack and keep going. For my surprise, I cannot receive any messages, until the entire batch is consummed. I thought max_concurrency could solve this, but as I see, It's not working. Here is my configuration:

[[queues.consumers]]
queue = "my-webhook"
max_batch_size = 100
max_batch_timeout = 3 #seconds
max_retries = 3
retry_delay = 30 #seconds
dead_letter_queue = "my-webhook-dlq"
max_concurrency = 20


So, say I reeive 10 messages in 3 seconds and start processing it ... Event if I use ctx.waitUntil(promisse) followed by a msg.ack{} it does not receive other batches until all messages on this batch finishes processing.

My handler

async queue(batch, env, ctx) { 
  for (const message of batch.messages) {
    try {
      ctx.waitUntil(processBody(message.body))
      message.ack()
    } catch (e) {
      message.retry()
    }
  }
}


Any tips on this?
Was this page helpful?