可以与Kafka客户端连接到EventHubs

发布于 2025-02-08 07:19:07 字数 1038 浏览 1 评论 0原文

我有一个带有“测试” EventHub的事件中心实例。

我可以连接到此并与本机客户端“ azure.messging.eventhubs”发布消息,

但是当我尝试与contruent.kafka(v1.1.0)客户端连接时

“未知错误(状态连接中的21286ms之后)” %3 | 1655301022.374 |错误| rdkafka#producer-1 | [thrd:sasl_plaintext://my-event-hub-namespace.servicebus.windows.net:9093/bootstra]: 1/1经纪人

我设定了生产者配置,并在下面创建生产者,以下

var config = new ProducerConfig
{
    BootstrapServers = "my-eventhub-namespace.servicebus.windows.net:9093",
    SecurityProtocol = SecurityProtocol.SaslSsl,
    SaslMechanism = SaslMechanism.Plain,
    SaslUsername = "$ConnectionString",
    SaslPassword = "Endpoint=sb://my-eventhub-namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=MySharedAccessKey==",
};

using (var producer = new ProducerBuilder<long, string>(config).SetKeySerializer(Serializers.Int64).SetValueSerializer(Serializers.Utf8).Build())
{

关于我出错的地方的想法?


更新:
与本机客户端连接时,它正在使用WebSocket进行连接,因此它可能是网络/防火墙问题。 感谢您的时间。

I have an event hubs instance with a “test” eventhub.

I can connect to this and publish messages with the native client "Azure.Messaging.EventHubs"

However when I try to connect with the Confluent.Kafka (v1.1.0) client I get

“Unknown error (after 21286ms in state CONNECT)”
%3|1655301022.374|ERROR|rdkafka#producer-1|
[thrd:sasl_plaintext://my-event-hub-namespace.servicebus.windows.net:9093/bootstra]:
1/1 brokers are down

I'm setting the producer config, and creating producer as below

var config = new ProducerConfig
{
    BootstrapServers = "my-eventhub-namespace.servicebus.windows.net:9093",
    SecurityProtocol = SecurityProtocol.SaslSsl,
    SaslMechanism = SaslMechanism.Plain,
    SaslUsername = "$ConnectionString",
    SaslPassword = "Endpoint=sb://my-eventhub-namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=MySharedAccessKey==",
};

using (var producer = new ProducerBuilder<long, string>(config).SetKeySerializer(Serializers.Int64).SetValueSerializer(Serializers.Utf8).Build())
{

Any ideas as to where I'm going wrong?


Update :
When connecting with the native client it's connecting using WebSockets, so it's probably networking/firewall issue.
Thanks for your time.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沙与沫 2025-02-15 07:19:07

几件事可以尝试

  • 防火墙检查EH端点。确保客户端可以连接到my-eventhub-namespace.servicebus.windows.net:9093。
  • 如果使用实体级SAS,请尝试使用名称空间级连接字符串。

A couple of things to try

  • Firewall check for EH endpoint. Make sure the client can connect to my-eventhub-namespace.servicebus.windows.net:9093.
  • Try with a namespace-level connection string if you used entity-level SAS.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文