.Net Core Event Hub 客户端生产者代码执行无异常,但消息未传递

Whi*_*Rom 5 c# azure-eventhub .net-core

我最近开始使用EventHub并遇到问题:消息生成的代码执行时没有任何异常,但消息未发布到EventHub。

我正在验证该消息不是通过控制台应用程序中的简单消费者以及通过我们的客户(拥有 EventHub 帐户并可以使用指标访问其门户)的信件发布的。生产者/消费者的代码取自https://learn.microsoft.com/en-us/azure/event-hubs/get-started-dotnet-standard-send-v2

生产者代码:

            var ConnectionString = "Endpoint=sb://{EventHub Namespace}.servicebus.windows.net/;SharedAccessKeyName={KeyName};SharedAccessKey={Key};EntityPath={EventHub Instance}"
            await using (var producerClient = new EventHubProducerClient(ConnectionString))
            {
                var batch = await producerClient.CreateBatchAsync();
                batch.TryAdd(new EventData(Encoding.UTF8.GetBytes("test1 message")));
                await producerClient.SendAsync(batch);
            }
            
Run Code Online (Sandbox Code Playgroud)

当我使用相同的代码和连接字符串连接到我的私有 Eventhub 时,我可以在 EventHub 中发送/接收消息。

EventHub客户端执行生成消息代码但未成功传递消息的原因可能是什么?

附加信息:

对 https://{EventHub Namespace}.servicebus.windows.net 的请求返回成功的响应。

“.\psping.exe -n 25 -i 1 -q {EventHub Namespace}.servicebus.windows.net:5671 -nobanner”显示 0% 损失