Azure 服务总线 - 随机反序列化问题

标签 azure queue azureservicebus servicebus azure-servicebus-queues

我的服务总线队列最近遇到了问题。随机消息(一个可以通过,另一个不能)被放置在死信队列中,并显示错误消息:

"DeadLetterReason": "Moved because of Unable to get Message content There was an error deserializing the object of type System.String. The input source is not correctly formatted."
"DeadLetterErrorDescription": "Des"

甚至在我的消费者有机会从队列接收消息之前,这种情况就会发生。

奇怪的是,当我通过 Service Bus Explorer 重新排队消息时,它会通过并被我的消费者成功接收和处理。

我使用相同版本的服务总线来发送和接收消息:

Azure.Messaging.ServiceBus, version: 7.2.1

我的消息是这样发送的:

        await using var client = new ServiceBusClient(connString);
        var sender = client.CreateSender(endpointName);
        var message = new ServiceBusMessage(serializedMessage);
        await sender.SendMessageAsync(message).ConfigureAwait(true);

最佳答案

因此,我现在针对所描述的问题的解决方案是,我对进入死信队列的消息实现了重试策略。该消息从 DLQ 克隆并再次添加到 ServiceBus 队列中,第二次没有任何问题,消息成功完成。我认为发生这种情况是因为 Azure 基础设施中可能存在一些奇怪的性能问题。但这种方法为我赢得了一些时间来进一步调查。

关于Azure 服务总线 - 随机反序列化问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69103153/

相关文章:

Azure服务总线: Use functions vs service fabric vs web job?

azure - 如何将消息推送到azure服务总线并触发azure函数来记录它看到消息

azure - Powershell 获取所有 Azure 资源的每月消耗量

azure - 更新azure devops发布管道: Tasks with versions 'Deploy Plataform 3:1.*' are not valid for deploy job 'Run on agent'

java - 为什么不能实例化内部存储整数的优先级队列

jquery - 在步骤中停止 jquery 动画,然后设置动画属性

azure - 当我们为 Azure SQL Server 定义 Active Directory 管理员时,是否可以删除服务器管理员?

azure - 在 kudu 中运行 npm 脚本

php - NodeJS 推送队列,由 Laravel worker 使用

Azure 推送通知随机工作