This is a monkey patch for Kombu QoS class, changing SQS visibility timeout exponentially, depending on number of retries
If you like to change the backoff policy / retry function, you can alter the celery.py=>retry_policy dictionary with a function
- Docker-compose takes
<queue name>
argument, feel free changing it - svc.app.api takes
<queue name>
parameter as well - svc.celery takes
<queue name>
parameter as well - svc.tasks.tasks takes
broker_transport_options
, change it accourding to your queue settings - svc.tasks.tasks takes
app.conf.broker_url
, hould be filled with sqs url with following format
sqs://<aws access key>:<aws secret>@sqs.us-east-1.amazonaws.com/<account id>/<queue name>
Calling http://localhost:5000/task
will add a new message to the queue, the task will fail on ZeroDivisionError, in order to demonstrate the solution