简体   繁体   English

Azure 消息队列中的消息直接进入中毒消息队列

[英]Messages in Azure Message Queue are going Straight to the Poison Message Queue

[Hoping this might save someone some time.] [希望这可以节省一些时间。]

The code below stopped working when moving to the newer QueueClient class (in Azure.Storage.Queues) from the deprecated CloudQueue class (in Microsoft.Azure.Storage.Queue):当从已弃用的CloudQueue class(在 Microsoft.Azure.Storage.Queue 中)移动到较新的QueueClient class(在 Azure.Storage.Queues 中)时,以下代码停止工作:

QueueClient queue = new QueueClient(accountConnectionString, "myQueuename");
queue.Create();
queue.SendMessage(msg);

Messages are being moved into the associated poison message queue, and I don't see any error messages in Azure's ApplicationInsights.消息被移入关联的有害消息队列,我在 Azure 的 ApplicationInsights 中没有看到任何错误消息。

When I manually move the message in Azure Storage Explorer from the poison message queue back into the queue, it works!当我手动将 Azure 存储资源管理器中的消息从毒消息队列移回队列时,它起作用了!

The CloudQueue class defaulted to using base64 encoding in the prior v11 library, whereas QueueClient does not! CloudQueue class 在之前的 v11 库中默认使用base64编码,而QueueClient没有!

To set base64 encoding, add a QueueClientOptions :要设置base64编码,请添加QueueClientOptions

QueueClientOptions queueOptions = new() { MessageEncoding = QueueMessageEncoding.Base64 };
QueueClient queue = new QueueClient(accountConnectionString, "myQueuename", queueOptions);
queue.Create();
queue.SendMessage(msg);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure服务总线中是否存在Poison Queue? - Does Poison Queue exists in Azure Service Bus? 如何根据消息属性筛选 Azure 服务总线队列消息? - how do I filter Azure Service Bus Queue messages based on a message property? 消息队列与任务队列的区别 - Message Queue vs Task Queue difference 使用消息队列绑定时如何处理Azure Function重跑? - How to handle an Azure Function rerunning when using message queue binding? AWS 控制台如何为 FIFO 队列接收具有相同消息组 ID 的多条消息? - How does the AWS Console receive multiples messages with same message group ID for a FIFO queue? 调用 Azure Function(队列触发器)不起作用,但是当我从 azure 门户发送消息时它起作用 - Calling Azure Function ( Queue Trigger) Doesnt work , but it does when i send i message from azure portal 两个 AWS SQS FIFO 队列消费者何时可以处理具有相同组消息 ID 的消息? - When can two AWS SQS FIFO queue consumers process messages with the same group message id? 无法使用托管身份将消息从 Azure API 发布到 Azure 服务总线队列 - Unable to post message to Azure Service Bus Queue from Azure API using Managed Identity 使用服务总线队列中的批量消息而不是为每条消息触发它的方法 - Way to consume bulk messages from Service Bus Queue instead of triggering it for each message 消息写入 SNS 主题,但没有订阅 SQS 队列 - Message written to SNS topic, but no SQS queue subscribed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM