Docker以及Kubernetes的EventHub连接问题

发布于 2025-02-11 14:46:09 字数 1845 浏览 1 评论 0原文

我有一个使用C#的Confluent Kafka库的代码。
我能够正确从本地系统连接到Azure事件中心。
但是,当我将其放在容器中时。我会收到以下错误。

3|1656401522.469|ERROR|rdkafka#consumer-1| [thrd:app]: rdkafka#consumer-1: sasl_ssl://xyz.servicebus.windows.net:9093/bootstrap: Disconnected (after 148ms in state UP)
%6|1656401522.626|FAIL|rdkafka#consumer-1| [thrd:sasl_ssl://xyz.servicebus.windows.net:9093/bootstrap]: sasl_ssl://xyz.servicebus.windows.net:9093/bootstrap: Disconnected (after 124ms in state UP, 1 identical error(s) suppressed)


%3|1656399913.942|ERROR|rdkafka#consumer-1| [thrd:sasl_ssl://xyz.servicebus.windows.net:9093/bootstrap]: 1/1 brokers are down
%3|1656399922.791|ERROR|rdkafka#consumer-1| [thrd:sasl_ssl://xyz.servicebus.windows.net:9093/bootstrap]: 1/1 brokers are down
fail: Microsoft.Extensions.Hosting.Internal.Host[9]
      BackgroundService failed
      Confluent.Kafka.ConsumeException: Broker: Topic authorization failed

这里有什么建议吗?有人吗?

新错误

Disconnected while requesting ApiVersion: might be caused by incorrect security.protocol configuration (connecting to a SSL listener?) or broker version is < 0.10 (see api.version.request) (after 0ms in state APIVERSION_QUERY, 4 identical error(s) suppressed)

我的配置

                    EnableAutoOffsetStore = false,
                    BootstrapServers = _configuration["KAFKA_SERVER"],
                    GroupId = consumerGroup,
                    AutoOffsetReset = AutoOffsetReset.Earliest,
                    SecurityProtocol = SecurityProtocol.SaslSsl,
                    SaslMechanism = SaslMechanism.Plain,
                    SaslUsername = "$ConnectionString",
                    SaslPassword = _configuration["EVENTHUB_CONNSTR"],
                    SslCaLocation = _configuration["EVENTHUB_CA_CERT_LOCATION"]

I have a code, which uses the Confluent Kafka library, written in C#.
I Am able to connect to the Azure event hub from my local system properly.
However, when I put the same in the container. I get the following error.

3|1656401522.469|ERROR|rdkafka#consumer-1| [thrd:app]: rdkafka#consumer-1: sasl_ssl://xyz.servicebus.windows.net:9093/bootstrap: Disconnected (after 148ms in state UP)
%6|1656401522.626|FAIL|rdkafka#consumer-1| [thrd:sasl_ssl://xyz.servicebus.windows.net:9093/bootstrap]: sasl_ssl://xyz.servicebus.windows.net:9093/bootstrap: Disconnected (after 124ms in state UP, 1 identical error(s) suppressed)


%3|1656399913.942|ERROR|rdkafka#consumer-1| [thrd:sasl_ssl://xyz.servicebus.windows.net:9093/bootstrap]: 1/1 brokers are down
%3|1656399922.791|ERROR|rdkafka#consumer-1| [thrd:sasl_ssl://xyz.servicebus.windows.net:9093/bootstrap]: 1/1 brokers are down
fail: Microsoft.Extensions.Hosting.Internal.Host[9]
      BackgroundService failed
      Confluent.Kafka.ConsumeException: Broker: Topic authorization failed

Any suggestions here ? Anyone ?

New Error

Disconnected while requesting ApiVersion: might be caused by incorrect security.protocol configuration (connecting to a SSL listener?) or broker version is < 0.10 (see api.version.request) (after 0ms in state APIVERSION_QUERY, 4 identical error(s) suppressed)

Any my configuration

                    EnableAutoOffsetStore = false,
                    BootstrapServers = _configuration["KAFKA_SERVER"],
                    GroupId = consumerGroup,
                    AutoOffsetReset = AutoOffsetReset.Earliest,
                    SecurityProtocol = SecurityProtocol.SaslSsl,
                    SaslMechanism = SaslMechanism.Plain,
                    SaslUsername = "$ConnectionString",
                    SaslPassword = _configuration["EVENTHUB_CONNSTR"],
                    SslCaLocation = _configuration["EVENTHUB_CA_CERT_LOCATION"]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文