【Azure 事件中心】使用Apache Flink 连接 Event Hubs 出错 Kafka error: No resolvable bootstrap urls - LuBu0505/My-Code GitHub Wiki

问题描述

参考Github上 Event Hub的示例代码(Using Apache Flink with Event Hubs for Apache Kafka Ecosystems : https://github.com/Azure/azure-event-hubs-for-kafka/tree/master/tutorials/flink),使用Apache Flink kafka连接中国区的Azure Event Hub,遇到 **Kafka error: No resolvable bootstrap urls **

kafkashaded.org.apache.kafka.common.KafkaException: Failed to construct kafka consumer

Caused by: kafkashaded.org.apache.kafka.common.config.ConfigException: No resolvable bootstrap urls given in bootstrap.servers

根据文档只修改了下图中红色标记的部分: image.png

问题解答

根据错误消息,知道是** bootstrap servers url** 的配置错误,bootstrap.servers=mynamespace.servicebus.windows.net:9093, 因为Github上的示例代码以Global Azure的Event Hub服务的终结点为例,而当前使用的是中国区的Azure Event Hub。中国区正确的 Endpoint 为: bootstrap.servers=mynamespace. servicebus.chinacloudapi.cn:9093 

This error message occurs when an invalid hostname or IP address is passed to the kafka.bootstrap.servers configuration, The Kafka bootstrap server is not running at the given hostname or IP address.

参考资料

Using Apache Flink with Event Hubs for Apache Kafka Ecosystems : https://github.com/Azure/azure-event-hubs-for-kafka/tree/master/tutorials/flink

Kafka error: ****No resolvable bootstrap urls:https://learn.microsoft.com/en-us/azure/databricks/kb/streaming/kafka-no-resolvable-bootstrap-urls

当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!

分类: 【Azure 事件中心】

标签: Event Hub Kafka errorNo resolvable bootstrap urls