pubsub streaming pull nack vs no acknowledge 行为
pubsub streaming pull nack vs no acknowledge behaviour
nack() 有以下行为
nack()
"""Decline to acknowldge the given message.
This will cause the message to be re-delivered to the subscription.
现在在流式拉取中,我正在拉取 taxiride streaming data 测试了以下行为。
用 nack()
流式拉取继续接收之前 nacked()
的消息
既不是 nack() 也不是 ack()
流读取最初的一堆消息并等待很长时间。我等了将近 15 分钟,但没有收到任何新消息。
现在我的问题是,在流式拉取中,当消息既不是 ack() 也不是 nack() 时,处理这些消息的预期行为和正确方法是什么?
假设我是否想每分钟计算一次积压消息作为处理要求?
当一条消息既没有 acked 也没有 nacked 时,云 Pub/Sub 客户端库维护消息的租约,最多 maxAckExtensionPeriod. Once that time period has passed, the message will be nacked and redelivered. The reason you are not getting any more messages when you neither ack nor nack is likely because you are running into the values specified in the flowControlSettings,这限制了未完成和未处理的消息的数量尚未 acked 或 nacked。
它通常是既不确认也不拒绝消息的反模式。如果您成功处理了消息,您应该确认它。如果您无法处理它(比如发生某种类型的暂时性异常),那么您应该拒绝它。尝试在不执行这些操作之一的情况下接收消息并不是计算积压消息数量的有效方法。
nack() 有以下行为
nack() """Decline to acknowldge the given message. This will cause the message to be re-delivered to the subscription.
现在在流式拉取中,我正在拉取 taxiride streaming data 测试了以下行为。
用 nack() 流式拉取继续接收之前 nacked()
的消息既不是 nack() 也不是 ack() 流读取最初的一堆消息并等待很长时间。我等了将近 15 分钟,但没有收到任何新消息。
现在我的问题是,在流式拉取中,当消息既不是 ack() 也不是 nack() 时,处理这些消息的预期行为和正确方法是什么? 假设我是否想每分钟计算一次积压消息作为处理要求?
当一条消息既没有 acked 也没有 nacked 时,云 Pub/Sub 客户端库维护消息的租约,最多 maxAckExtensionPeriod. Once that time period has passed, the message will be nacked and redelivered. The reason you are not getting any more messages when you neither ack nor nack is likely because you are running into the values specified in the flowControlSettings,这限制了未完成和未处理的消息的数量尚未 acked 或 nacked。
它通常是既不确认也不拒绝消息的反模式。如果您成功处理了消息,您应该确认它。如果您无法处理它(比如发生某种类型的暂时性异常),那么您应该拒绝它。尝试在不执行这些操作之一的情况下接收消息并不是计算积压消息数量的有效方法。