Fix message missing after duplicated message error

Message will not be handle after acknowledge failure, but it will store
in cache to prohibit handle duplicate message by skipping it.
So a message can be missed if client receive a duplicate message.

Fix this problem by store the message info in cache after a successfuly
message acknowledgment.

Change-Id: I907a58199eeadac22c31490111ec51ee6dd874d5
This commit is contained in:
QingchuanHao 2015-08-11 07:45:01 +08:00
parent e72dc250b3
commit c70bf40be4

View File

@ -102,8 +102,8 @@ class AMQPIncomingMessage(base.IncomingMessage):
self._send_reply(conn, ending=True)
def acknowledge(self):
self.listener.msg_id_cache.add(self.unique_id)
self.acknowledge_callback()
self.listener.msg_id_cache.add(self.unique_id)
def requeue(self):
# NOTE(sileht): In case of the connection is lost between receiving the