Azure 队列 - return 到队列头部的消息超时
Azure queue - return timed out messages to the head of the queue
当从 azure 队列中检索到一条消息但未从中删除时,消息可见性超时到期并且消息被(重新)添加到队列的末端。
有没有办法 return 将此类消息发送到队列的 头 ?
当 Azure 队列消息重新出现时,它们不一定会发送到队列末尾。它们只是重新出现,到那时,并不能真正保证秩序。它甚至不会从当前位置移动;它再次可见。 Azure 存储队列不是为保证顺序设置的。所以不,当消息在其隐身超时到期后重新出现时,无法强制消息出现在队列的头部。
此外,请查看 Jai Haridas 关于队列消息排序的 this forum answer。具体来说:
The messages in a queue today are sorted by its visibility time. So the ordering of messages purely depends on when they are made visible. However, it is important for an app to not assume FIFO order or any specific order as it may change in future. You can only rely that 1) a message will be eligible based on its visibility timeout and 2) Message processing should be made idempotent and use the new UpdateMessage to save state
UpdateMessage()
允许您修改队列消息(e.g.adding面包屑),因此下次开始处理它时,您可以在"start." 请注意,您还可以调整超时值,当它仍然在您手中且不可见时,您可以继续处理消息。
当从 azure 队列中检索到一条消息但未从中删除时,消息可见性超时到期并且消息被(重新)添加到队列的末端。
有没有办法 return 将此类消息发送到队列的 头 ?
当 Azure 队列消息重新出现时,它们不一定会发送到队列末尾。它们只是重新出现,到那时,并不能真正保证秩序。它甚至不会从当前位置移动;它再次可见。 Azure 存储队列不是为保证顺序设置的。所以不,当消息在其隐身超时到期后重新出现时,无法强制消息出现在队列的头部。
此外,请查看 Jai Haridas 关于队列消息排序的 this forum answer。具体来说:
The messages in a queue today are sorted by its visibility time. So the ordering of messages purely depends on when they are made visible. However, it is important for an app to not assume FIFO order or any specific order as it may change in future. You can only rely that 1) a message will be eligible based on its visibility timeout and 2) Message processing should be made idempotent and use the new UpdateMessage to save state
UpdateMessage()
允许您修改队列消息(e.g.adding面包屑),因此下次开始处理它时,您可以在"start." 请注意,您还可以调整超时值,当它仍然在您手中且不可见时,您可以继续处理消息。