hullo i just across this today, could either be a local thing or swapping to `promise.allSettled`, e
hullo i just across this today, could either be a local thing or swapping to
promise.allSettled, egasync queue(batch, env, ctx) {
await Promise.allSettled(
batch.messages.map((message) => processBody(message.body)
.then(() => {
// maybe `res?.ok` if its a fetch or something
message.ack()
})
.catch(() => {
message.retry()
})
)).finally(() => {
console.log('batch completed')
})
}
queueBacklogAdaptiveGroups)ack() a message, while you're still handling some stuff inside a ctx.awaitUntil(), the queue will wait with handling the next batch until the waitUntil is fully handled.wrangler r2 bucket notification[[queues.producers]]
binding = "WEBHOOK_QUEUE_1"
queue = "webhook-1"
[[queues.producers]]
binding = "WEBHOOK_QUEUE_2"
queue = "webhook-2"
[[queues.producers]]
binding = "WEBHOOK_QUEUE_3"
queue = "webhook-N"
[[queues.consumers]]
queue = "webhook-1"
max_batch_size = 10
max_batch_timeout = 2
max_retries = 3
retry_delay = 30
dead_letter_queue = "webhook-dlq"
[[queues.consumers]]
queue = "webhook-2"
max_batch_size = 10
max_batch_timeout = 2
max_retries = 3
retry_delay = 30
dead_letter_queue = "webhook-dlq"
[[queues.consumers]]
queue = "webhook-N"
max_batch_size = 10
max_batch_timeout = 2
max_retries = 3
retry_delay = 30
dead_letter_queue = "webhook-dlq"