You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to create a Python script that waits for a message on a RabbitMQ queue to start a task in a subprocess. During task execution, the script continues to consume another queue for a cancel order that would stop the task.
I use kombu package to handle interactions with RabbitMQ. I call message.ack() when the task terminates (whether normally or because of cancellation).
Despite the call to message.ack(), the start message is not removed from the queue (I can tell by using rabbitmqctl). This causes the message to be redelivered even if the task ran to completion.
I do not know where the problem could be. I realize there are many moving parts but this is a slightly simplified version of a real project with its own constraints (like the Python version being fixed to 3.8). I am open to any suggestion to make a better use of kombu or asyncio because I am quite new to AMQP and async Python.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to create a Python script that waits for a message on a RabbitMQ queue to start a task in a subprocess. During task execution, the script continues to consume another queue for a cancel order that would stop the task.
I use kombu package to handle interactions with RabbitMQ. I call message.ack() when the task terminates (whether normally or because of cancellation).
Despite the call to message.ack(), the start message is not removed from the queue (I can tell by using rabbitmqctl). This causes the message to be redelivered even if the task ran to completion.
I created a sample repository to show the problem. The README file shows the reproduction steps.
I do not know where the problem could be. I realize there are many moving parts but this is a slightly simplified version of a real project with its own constraints (like the Python version being fixed to 3.8). I am open to any suggestion to make a better use of kombu or asyncio because I am quite new to AMQP and async Python.
Beta Was this translation helpful? Give feedback.
All reactions