Hi, how do I deal with queue consumer timeout issue? i.e. make sure queue consumer completed the ta

Hi, how do I deal with queue consumer timeout issue? i.e. make sure queue consumer completed the task with payload? Is there anyway to have queue retry calling consumer unless consumer explicitly acknowledge the payload was processed susessfully?
14 Replies
oof2win2
oof2win2•4mo ago
how can i set proper types for a queue? like it seems that i need to change it on the generated env types but then i can't have them be generated more importantly it doesn't work for receiving the messages via the same queue
elithrar
elithrar•4mo ago
The TypeScript types for the queue handler (your consumer) accept a type parameter - so async queue<T>(batch: MessageBatch, env: Env) - which will mean that each message in MessageBatch has a typed payload based on your type parameter T
oof2win2
oof2win2•4mo ago
thanks!
snapo
snapo•4mo ago
Hey people! When developing locally, I have configured my queue with following retry timeouts and counts:
max_retries = 10,
retry_delay = 30
max_retries = 10,
retry_delay = 30
I noticed that for some unknown reason, the retry logic only attempts up to 3 times. If I lower the retry_delay to 10 seconds, I can reach 6th attempt. If I finally lower the delay to 2 seconds, I can reach 10 retry attempts which is expected. Any ideas, why the 30s delay is not working and 2 seconds is? 🤔
Kaique Anarkrypto
Kaique Anarkrypto•4mo ago
it's possible to list messages inside dead queue?
snapo
snapo•4mo ago
You can do it via the dashboard. If you want to use http then you could configure a pull consumer for the dlq
Kaique Anarkrypto
Kaique Anarkrypto•4mo ago
So I would need to implement my own api to retrieve the dlq messages?
snapo
snapo•4mo ago
Cloudflare Docs
Pull consumers | Cloudflare Queues
A pull-based consumer allows you to pull from a queue over HTTP from any environment and/or programming language outside of Cloudflare Workers. A pull-based consumer can be useful when your message consumption rate is limited by upstream infrastructure or long-running tasks.
snapo
snapo•4mo ago
Cloudflare API Documentation
Interact with Cloudflare's products and services via the Cloudflare API
Kaique Anarkrypto
Kaique Anarkrypto•4mo ago
Thanks
Pranshu Maheshwari
Pranshu Maheshwari•4mo ago
Dead letter queues behave just like normal queues. You could setup a consumer, just like you would with a normal queue. It doesn't necessarily need to be a pull consumer; you could use a worker too.
Kaique Anarkrypto
Kaique Anarkrypto•4mo ago
But I would need to store the messages somewhere I don’t want to need to add an extra db only for this Ideally queues could allows us to list pending messages
piffie
piffie•4mo ago
is there a way of getting the name of the queue, when you have the queue object?
clearwater4227
clearwater4227•4mo ago
Hi everyone! I am starting looking into using queues but have one question...can I configure a worker script as a queue consumer through terraform? I havent found the setup yet..still looking but if anyone here knows or can point me to the info... it looks like I can configure the queue reference on a worker to send a message but I need to configure the consumer through terraform also.
Want results from more Discord servers?
Add your server