azure - 使用 Kafa 和 Azure 事件中心连接字符串接收数据

标签 azure apache-kafka azure-eventhub eventhub

我是新使用这些资源的,所以如果有错误或不可能的地方,请纠正我。我有一个事件中心连接字符串和一个命名空间。不幸的是,我无权访问事件中心本身。据我了解,事件中心连接到数据库,如果数据中有新条目或更改,则会发送一条消息并触发事件中心。

我将使用 Kafka 监听事件中心,如果事件中心被触发,Kafka 会将新条目写入 Blob 存储帐户。使用 Kafka 可行吗?连接字符串和命名空间是否足以将 Kafka 与事件中心连接起来?

我尝试使用事件中心 Python 库并收到身份验证错误。是否还可以测试连接字符串?

提前致谢!

最佳答案

Yes, it is possible to use Kafka to listen to an Azure Event Hub and write the data to a blob storage account.

Kafka 本身并不与 Azure 事件中心集成。使用 Kafka Connect 框架以及 Kafka Connect Azure 事件中心连接器来实​​现此集成。 Kafka Connect 框架允许将 Kafka 与各种数据源和接收器连接。

要将 Kafka 与事件中心连接,请将 {YOUR.EVENTHUBS.CONNECTION.STRING} 替换为 Kafka 配置文件中事件中心命名空间的连接字符串。

enter image description here

设置 Kafka Connect 与 Azure 事件中心

  • 在系统上安装并设置 Apache Kafka。

  • 从 Confluence Hub 下载并安装 Kafka Connect Azure 事件中心连接器

  • 连接器启动并运行后,它将监听您的 Azure 事件中心并将数据提取到 Kafka 主题中。

  • 并使用来自 Kafka 的数据并执行任何进一步处理或将其写入 Blob 存储帐户。

The authentication error you encountered with the Event Hubs Python library, check the correct connection string and have the necessary permissions to access the Event Hub. And access rights assigned to your account.

使用 Azure CLI 或 Azure 门户测试连接字符串。

Azure CLI 命令:

az eventhubs namespace authorization-rule keys list --namespace-name <namespace> --name <authorization-rule-name> --query primaryConnectionString --output tsv

引用资料取自Integrate with Apache Kafka Connect- Azure Event HubsKafka with Azure - Streaming Unlimited Data Into Cloud .

关于azure - 使用 Kafa 和 Azure 事件中心连接字符串接收数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76559577/

相关文章:

azure - 如何在EventHub上查看所有连接的消费者

azure - 如何使用 Terraform 中的循环来部署 2 个不同的 azure 资源

azure - 使用逻辑应用发送电子邮件,但有电子邮件地址列表

python - 如何在融合的kafka python中读取批处理消息?

java - 在storm集群上部署拓扑时出错

Azure Functions - 事件中心不触发函数

azure - Azure Web 应用程序部署上的 503/417 错误

azure - 如何将 secret 变量从一个阶段传递到另一个Azure DevOps管道?

apache-kafka - 如何设置状态存储更改日志主题的 max.message.bytes?

azure - 如何检查 Azure Eventhub 的运行状况