什么原因可能导致在完成 Azure Service Bus 中的消息时出现 ‘AMQPLinkError’?

huangapple go评论72阅读模式
英文:

What could be causing 'AMQPLinkError' when completing messages in Azure Service Bus?

问题

Azure Service Bus异常在完成消息时出现:
ServiceBusError: 在'amqp:disposition:list'中未设置所需字段'first'。错误条件:amqp:invalid-field。

所以基本上我正在尝试从Service Bus中读取一批消息,迭代消息以收集负载,将它们组合并写入存储,然后再迭代一批消息以逐个完成它们。

代码在将负载放入存储方面运行正常,但是一旦消息被完成,我会收到这个错误,我无法找到关于它的太多信息,也不太清楚缺少的部分应该是什么,或者为什么没有... 但底层的异常是"AMQPLinkError"。

代码块

这段代码基本上与文档中的类似,只有一些小的更改。

到目前为止,我已尝试了同步和异步版本,尝试了调整批处理大小和定时参数,但仍然遇到相同的问题。

最奇怪的是,有些运行完全正常,但在其他时候,会因为不明确的原因而引发此异常。

英文:

Azure Service Bus exception when completing messages:
ServiceBusError: The required field 'first' is not set in 'amqp:disposition:list'. Error condition: amqp:invalid-field.

So essentially what im trying to do is read a batch of messages from the servicebus, iterate over the messages to collect the payloads, combine them, and write it all to storage and go back to iterate over the batch of messages again to complete them one by one.

The code works fine in terms of getting the payloads into storage, however once the messages are being completed off, i get this error that i cannot find much information about and it's not very clear on what the missing piece is meant to be or why it's not there... But the underlying exceptions is "AMQPLinkError"

Code block

The code is pretty much similar to what's in the documentation with some small changes.

I've so far tried both sync and async version, tried playing around with batch sizes and timing params, but still get the same issue.

The weirdest thing is that some runs complete fine, however at other times this exception is raised without clear reasoning as to why.

All this code runs in databricks.

答案1

得分: 0

嗨 @Andrius Vitkauskas,

我在那个团队工作,我们正在修复这个错误。要绕过这个问题,有两种方法:

  1. 使用uamqp传输,在连接时传递uamqp_transport=True。您需要使用pip安装uamqp。
  2. 回到以前的Service Bus版本,本质上将您切换回uamqp。

对于问题我们感到抱歉。我们希望尽快解决这个问题。

英文:

Hi @Andrius Vitkauskas,

I work on that team and we are fixing that bug right now. To go around there are two ways to do so:

  1. use the uamqp transport by passing in uamqp_transport=True during connection. You will have to pip install uamqp
  2. go back to the previous version of service bus, which essentially moves you back to uamqp.

Sorry about the issues. We hope to get this resolved asap.

huangapple
  • 本文由 发表于 2023年5月23日 00:50:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/76308367.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定