gpt4 book ai didi

azure - 如何判断 Azure CloudQueue.AddMessage 是否成功?

转载 作者:行者123 更新时间:2023-12-03 00:11:58 25 4
gpt4 key购买 nike

当您将消息发布到 Azure 队列时,如何判断消息是否已成功发布?

当使用以下代码时:

queue.AddMessage(message);

我们发现在某些情况下消息不会发布到队列中。正在查看the documentation我可以看到,如果消息发布不成功,则不会抛出异常。检查消息发布是否失败的最佳方法是什么?

最佳答案

通常,如果消息未写入队列,您应该会看到错误。不过,您可以做的一件事是检查消息的消息 ID、插入、过期时间属性,因为一旦消息成功插入,它们将由 SDK 填充。

来自documentation link :

The CloudQueueMessage message passed in will be populated with the pop receipt, message ID, and the insertion/expiration time.

关于azure - 如何判断 Azure CloudQueue.AddMessage 是否成功?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43736187/

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