summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2014-08-17 00:22:12 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2014-09-02 18:06:19 +0000
commite389ee61d109a6b1e4908bde97547d5dbda596e3 (patch)
tree9cff2018cbdf671862f1aa62a666da367ae11264
parent8109207baeaf7f1a07c847bd74db7b58f3572610 (diff)
downloadtaskflow-e389ee61d109a6b1e4908bde97547d5dbda596e3.tar.gz
Reject WBE messages if they can't be put in an ack state
Attempt to reject messages that could not be acknowledged so that those messages could be resent (requeueing is not appropriate since it will just cause the message to come back). Fixes bug 1364543 Change-Id: I2cb33b39be950528fa9e22d9a11722bedd0927aa
-rw-r--r--taskflow/engines/worker_based/dispatcher.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/taskflow/engines/worker_based/dispatcher.py b/taskflow/engines/worker_based/dispatcher.py
index 9ff8ac1..9321b99 100644
--- a/taskflow/engines/worker_based/dispatcher.py
+++ b/taskflow/engines/worker_based/dispatcher.py
@@ -93,6 +93,9 @@ class TypeDispatcher(object):
LOG.debug("AMQP message %r acknowledged.",
message.delivery_tag)
handler(data, message)
+ else:
+ message.reject_log_error(logger=LOG,
+ errors=(kombu_exc.MessageStateError,))
def on_message(self, data, message):
"""This method is called on incoming messages."""