EventHub Golang客户端错误:amqp:内部错误

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

EventHub Golang client error: amqp:internal-error

问题

我尝试使用EventHub Go客户端发送一个简单的“hello world”事件,但是收到了以下错误消息:

*Error{Condition: amqp:internal-error, Description: The service was unable to process the request; please retry the operation. For more information on exception types and proper exception handling, please refer to http://go.microsoft.com/fwlink/?LinkId=761101 TrackingId:be0c66437a1447b7accdc113c84955dd_G5, SystemTracker:gateway5, Timestamp:2021-07-10T21:28:48, Info: map[]}

代码与这个示例代码完全相同:https://github.com/Azure/azure-event-hubs-go

我找到了一个类似错误消息的SO线程,链接在这里https://stackoverflow.com/questions/51831383/getting-amqpinternal-error-when-peeking-messages-from-azure-service-bus-queue,但是它是关于Service Bus和Node客户端的。

有任何想法为什么会出现这个问题?

英文:

I try to use EventHub Go client to send a simple "hello world" event but got this error message:

> *Error{Condition: amqp:internal-error, Description: The service was unable to process the request; please retry the operation. For more information on exception types and proper exception handling, please refer to http://go.microsoft.com/fwlink/?LinkId=761101 TrackingId:be0c66437a1447b7accdc113c84955dd_G5, SystemTracker:gateway5, Timestamp:2021-07-10T21:28:48, Info: map[]}

The code is exactly the same as this sample code here: https://github.com/Azure/azure-event-hubs-go

The SO thread I found which somehow has similar error message is here https://stackoverflow.com/questions/51831383/getting-amqpinternal-error-when-peeking-messages-from-azure-service-bus-queue, but it is for Service Bus and Node client.

Any idea why this issue occured?

答案1

得分: 2

这个错误信息并不是很具体。触发这个错误的一种方式是在EventHubs连接字符串中没有指定EntityPath=<event hub name>

所以,如果你正在使用一个代理级别的连接字符串,你需要通过添加EntityPath=eventHubName来指定你要连接的EventHub。readme片段中确实列出了这一点,但是在这种情况下,错误信息确实不太好。

我已经提交了这个问题,至少要改进错误信息,因为它并不能真正告诉你出了什么问题。

https://github.com/Azure/azure-event-hubs-go/issues/222

英文:

This error is pretty non-descriptive.
One way to trigger is to specify an EventHubs connection string without an EntityPath=<event hub name> in it.

So if you're using a broker level connection string you'll need to specify the EventHub you're attempting to connect to by adding EntityPath=eventHubName. The readme snippet does list this, but the error is admittedly not great in that situation.

I've filed this issue to at least improve the error message in that case, as it doesn't really lead you to what's wrong.

https://github.com/Azure/azure-event-hubs-go/issues/222

huangapple
  • 本文由 发表于 2021年7月11日 05:38:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/68331725.html
匿名

发表评论

匿名网友

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

确定