ef basic_nack(self, delivery_tag=None, multiple=False, requeue=True):
"""This method allows a client to reject one or more incoming messages.
It can be used to interrupt and cancel large incoming messages, or
return untreatable messages to their original queue.
:param integer delivery-tag: int/long The server-assigned delivery tag
:param bool multiple: If set to True, the delivery tag is treated as
"up to and including", so that multiple messages
can be acknowledged with a single method. If set
to False, the delivery tag refers to a single
message. If the multiple field is 1, and the
delivery tag is zero, this indicates
acknowledgement of all outstanding messages.
:param bool requeue: If requeue is true, the server will attempt to
requeue the message. If requeue is false or the
requeue attempt fails the messages are discarded or
dead-lettered.
"""
self._raise_if_not_open()
return self._send_method(
spec.Basic.Nack(delivery_tag, multiple, requeue))
来自pika docs的摘录说,你拼写错了
basic_nck
。。。只是一个问题错误还是你的实际问题?你知道吗很抱歉,但据我所知,是不可能的基本确认(或基本确认)修改标题。问题是“modified”消息将被放入死信队列,而新消息的ID较新
我-
basic_nack
不能更改头是正确的。你知道吗实现这一点的方法根本不是使用
NACK
,而是生成并返回一个“new”消息(这只是您正在处理的当前消息,但是向其中添加了新的头)。你知道吗根据AMQP规范,
NACK
基本上是这样做的所以我的逻辑是在成功时使用
basic_ack
,在失败时使用更新的消息头生成消息。在我的例子中,我将新消息“重定向”到死信队列绑定到的死信交换。你知道吗相关问题 更多 >
编程相关推荐