当您将消息发布到 Azure 队列时,如何判断消息是否已成功发布?
当使用以下代码时:
queue.AddMessage(message);
我们发现在某些情况下消息不会发布到队列中。正在查看the documentation我可以看到,如果消息发布不成功,则不会抛出异常。检查消息发布是否失败的最佳方法是什么?
最佳答案
通常,如果消息未写入队列,您应该会看到错误。不过,您可以做的一件事是检查消息的消息 ID、插入、过期时间属性,因为一旦消息成功插入,它们将由 SDK 填充。
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/