间接应用 message 的 acknowledged 属性就好了
if not message.acknowledged:
message.ack()
当咱们应用 acknowledged 的时候,其实干的是上面的事件:
kombu/message.py
@property
def acknowledged(self):
"""Set to true if the message has been acknowledged."""
return self._state in ACK_STATES
ACK_STATES 是什么呢?
kombu/message.py
ACK_STATES = {'ACK', 'REJECTED', 'REQUEUED'}
能够看到,曾经有三个状态了哦