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

标签 azure azure-queues

当您将消息发布到 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/

相关文章:

azure - 如何使用 .net 获取 Azure 容器实例 (ACI) exec 命令输出

angular - Azure Web 应用程序 Angular 5 + dotnet core 2.1 部署后刷新

azure-webjobs - Azure Webjobs SDK 和队列处理错误

c# - 确保为特定队列扩展不超过 N 个实例

azure - 使用 Azure 服务总线通过端口 80 发送消息

c# - Azure 应用服务未经授权的用户访问 Controller

powershell - Save-AzureRmProfile 的问题

Azure 流分析 - 无输出事件

php - Windows Azure PHP 队列 REST 代理限制

azure - 切换到 Azure.Storage.Queues 后 Azure Function 中的模型绑定(bind)问题