gpt4 book ai didi

c# - Azure 服务总线队列 - 将锁定的消息释放回队列

转载 作者:行者123 更新时间:2023-11-30 23:09:32 25 4
gpt4 key购买 nike

有没有办法在超时之前解锁队列中锁定的消息,以便队列再次可用(将锁定超时更改为非常小的值的方法就足够了)。

AWS SQS 中也提供了类似的功能,其中有(ChangeMes​​sageVisibility)来更改锁定超时,如果超时设置为很小的值,则消息将被释放回队列。

调用顺序:

  • 从生产者发送消息:queueClient.SendAsync
  • 接收来自消费者的消息:messageReceiver.ReceiveAsync
  • 消费者决定消息需要在队列中再次可用,这是我要求的步骤。

最佳答案

Is there a way to unlock a locked message in the queue before the timeout, so that it is available again to the queue

您正在寻找的方法是 Abandon 。这将释放消息锁。来自文档:

Abandons the lock on a peek-locked message.

关于c# - Azure 服务总线队列 - 将锁定的消息释放回队列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45776904/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com