What's the proper way to abandon an Azure SB Message so that it becomes visible again in the future in a way I can control?

前端 未结 5 1788
梦谈多话
梦谈多话 2020-12-17 08:38

So the scenario is that I\'m using an SB queue to throttle outgoing callbacks to other services. One of the standard problems with calling back to other services is that the

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-17 09:14

    In bullet #2 above: Can't you just set the TTL timespan on the message when calling Receive(TimeSpan) instead of the default Receive()? Then, you can simply abandon the message (without calling Abandon()), and the message should reappear in the queue when the TTL expires. While this doesn't give you fine-grain control to say "Reappear after x seconds," it does give you predictability for when the message does reappear.

    Note: With Storage-based queues, you can update the invisibility timeout, so that would give you fine-grain control for message re-appearance.

提交回复
热议问题