针对 Azure 事件中心的 Apache Kafka 开发人员指南Apache Kafka developer guide for Azure Event Hubs

本文提供相关文章的链接,这些文章介绍了如何将 Apache Kafka 应用程序与 Azure 事件中心集成。This article provides links to articles that describe how to integrate your Apache Kafka applications with Azure Event Hubs.

概述Overview

事件中心提供 Kafka 终结点,现有的基于 Kafka 的应用程序可将该终结点用作运行你自己的 Kafka 群集的替代方案。Event Hubs provides a Kafka endpoint that can be used by your existing Kafka based applications as an alternative to running your own Kafka cluster. 事件中心可与许多现有 Kafka 应用程序配合使用。Event Hubs works with many of your existing Kafka applications. 有关详细信息,请参阅适用于 Apache Kafka 的事件中心For more information, see Event Hubs for Apache Kafka

快速入门Quickstarts

你可以在 GitHub 和此内容集中找到各种快速入门文章,快速熟悉用于 Kafka 的事件中心。You can find quickstarts in GitHub and in this content set that helps you quickly ramp up on Event Hubs for Kafka.

GitHub 中的快速入门Quickstarts in GitHub

请参阅 azure-event-hubs-for-kafka 存储库中的以下快速入门教程:See the following quickstarts in the azure-event-hubs-for-kafka repo:

客户端语言/框架Client language/framework 说明Description
.NET.NET

本快速入门介绍如何使用通过 .Net Core 2.0 以 C# 编写的示例创建者和使用者来创建和连接事件中心 Kafka 终结点。This quickstart will show how to create and connect to an Event Hubs Kafka endpoint using an example producer and consumer written in C# using .NET Core 2.0.

此示例基于 Confluent 的 Apache Kafka .NET 客户端,经过修改后可与用于 Kafka 的事件中心配合使用。This sample is based on Confluent's Apache Kafka .NET client, modified for use with Event Hubs for Kafka.

JavaJava 本快速入门介绍如何使用以 Java 编写的示例创建者和使用者来创建和连接事件中心 Kafka 终结点。This quickstart will show how to create and connect to an Event Hubs Kafka endpoint using an example producer and consumer written in Java.
Node.jsNode.js

本快速入门介绍如何使用以 Node 编写的示例创建者和使用者来创建和连接事件中心 Kafka 终结点。This quickstart will show how to create and connect to an Event Hubs Kafka endpoint using an example producer and consumer written in Node.

此示例使用 node-rdkafka 库。This sample uses the node-rdkafka library.

PythonPython

本快速入门介绍如何使用以 Python 编写的示例创建者和使用者来创建和连接事件中心 Kafka 终结点。This quickstart will show how to create and connect to an Event Hubs Kafka endpoint using an example producer and consumer written in python.

此示例基于 Confluent 的 Apache Kafka Python 客户端,经过修改后可与用于 Kafka 的事件中心配合使用。This sample is based on Confluent's Apache Kafka Python client, modified for use with Event Hubs for Kafka.

GoGo

本快速入门介绍如何使用以 Go 编写的示例创建者和使用者来创建和连接事件中心 Kafka 终结点。This quickstart will show how to create and connect to an Event Hubs Kafka endpoint using an example producer and consumer written in Go.

此示例基于 Confluent 的 Apache Kafka Golang 客户端,经过修改后可与用于 Kafka 的事件中心配合使用。This sample is based on Confluent's Apache Kafka Golang client, modified for use with Event Hubs for Kafka.

Sarama kafka GoSarama kafka Go 本快速入门介绍如何使用通过 Sarama Kafka 客户端库以 Go 编写的示例创建者和使用者来创建和连接事件中心 Kafka 终结点。This quickstart will show how to create and connect to an Event Hubs Kafka endpoint using an example producer and consumer written in Go using the Sarama Kafka client library.
KafkaKafka 本快速入门介绍如何使用 Apache Kafka 发行版附带的 CLI 来创建和连接事件中心 Kafka 终结点。This quickstart will show how to create and connect to an Event Hubs Kafka endpoint using the CLI that comes bundled with the Apache Kafka distribution.
KafkacatKafkacat kafkacat 是一个非 JVM 的命令行使用者和创建者。它基于 librdkafka,因其速度快且资源占用量小而广受欢迎。kafkacat is a non-JVM command-line consumer and producer based on librdkafka, popular due to its speed and small footprint. 本快速入门包含一个示例配置和几个简单的示例 kafkacat 命令。This quickstart contains a sample configuration and several simple sample kafkacat commands.

DOCS 中的快速入门Quickstarts in DOCS

请参阅此内容集中的这个快速入门:使用 Kafka 协议通过事件中心进行数据流式传输,其中提供的分步说明介绍了如何将数据流式传输到事件中心。See the quickstart: Data streaming with Event Hubs using the Kafka protocol in this content set, which provides step-by-step instructions on how to stream into Event Hubs. 你将了解如何只需更改应用程序配置,即可使用生产者和使用者与事件中心通信。You learn how to use your producers and consumers to talk to Event Hubs with just a configuration change in your applications.

教程Tutorials

GitHub 中的教程Tutorials in GitHub

请参阅 GitHub 中的以下教程:See the following tutorials on GitHub:

教程Tutorial 说明Description
AkkaAkka 本教程演示如何在不更改协议客户端或运行自己的群集的情况下,将 Akka Streams 连接到已启用 Kafka 的事件中心。This tutorial shows how to connect Akka Streams to Kafka-enabled Event Hubs without changing your protocol clients or running your own clusters. 有两个单独的使用 JavaScala 编程语言的教程。There are two separate tutorials using Java and Scala programming languages.
“连接”Connect 本文档将详细介绍如何将 Kafka Connect 与 Azure 事件中心集成,以及如何部署基本的 FileStreamSource 和 FileStreamSink 连接器。This document will walk you through integrating Kafka Connect with Azure Event Hubs and deploying basic FileStreamSource and FileStreamSink connectors. 虽然这些连接器不是用于生产的,但它们可以用于演示端到端 Kafka Connect 方案,让 Azure 事件中心冒充 Kafka 中转站。While these connectors are not meant for production use, they demonstrate an end-to-end Kafka Connect Scenario where Azure Event Hubs masquerades as a Kafka broker.
FilebeatFilebeat 本文档详述如何通过 Filebeat 的 Kafka 输出来集成 Filebeat 和事件中心。This document will walk you through integrating Filebeat and Event Hubs via Filebeat's Kafka output.
FlinkFlink 本教程将演示如何在不更改协议客户端或运行自己的群集的情况下,将 Apache Flink 连接到已启用 Kafka 的事件中心。This tutorial will show how to connect Apache Flink to Kafka-enabled Event Hubs without changing your protocol clients or running your own clusters.
FluentDFluentD 本文档详述如何使用 Fluentd 的 out_kafka 输出插件来集成 Fluentd 和事件中心。This document will walk you through integrating Fluentd and Event Hubs using the out_kafka output plugin for Fluentd.
互操作Interop 本教程介绍如何在使用不同协议的使用者与创建者之间交换事件。This tutorial shows you how to exchange events between consumers and producers using different protocols.
LogstashLogstash 本教程详述如何将 Logstash 与使用 Logstash Kafka 输入/输出插件且支持 Kafka 的事件中心集成。This tutorial will walk you through integrating Logstash with Kafka-enabled Event Hubs using Logstash Kafka input/output plugins.
MirrorMakerMirrorMaker 本教程介绍事件中心和 Kafka MirrorMaker 如何通过在事件中心服务中镜像 Kafka 输入流将现有 Kafka 管道集成到 Azure 中。This tutorial shows how an event hub and Kafka MirrorMaker can integrate an existing Kafka pipeline into Azure by mirroring the Kafka input stream in the Event Hubs service.
NiFiNiFi 本教程演示如何将 Apache NiFi 连接到事件中心命名空间。This tutorial will show how to connect Apache NiFi to an Event Hubs namespace.
OAuthOAuth 这两个快速入门介绍如何使用以 Go 和 Java 编程语言编写的示例创建者和使用者来创建和连接事件中心 Kafka 终结点。Quickstarts show you how to create and connect to an Event Hubs Kafka endpoint using an example producer and consumer written in Go and Java programming languages.
Confluent 的架构注册表Confluent's Schema Registry 本教程详述如何将架构注册表与用于 Kafka 的事件中心集成。This tutorial will walk you through integrating Schema Registry and Event Hubs for Kafka.
SparkSpark 本教程将演示如何在不更改你的协议客户端或运行你自己的 Kafka 群集的情况下,将 Spark 应用程序连接到事件中心。This tutorial will show how to connect your Spark application to an event hub without changing your protocol clients or running your own Kafka clusters.

DOCS 中的教程Tutorials in DOCS

请参阅此内容集中的这个教程:使用流分析处理用于事件中心的 Apache Kafka 事件,该教程介绍如何将数据流式传输到事件中心,并使用 Azure 流分析对其进行处理。Also, see the tutorial: Process Apache Kafka for Event Hubs events using Stream analytics in this content set, which shows how to stream data into Event Hubs and process it with Azure Stream Analytics.

操作指南How-to guides

请参阅文档中的以下操作指南:See the following How-to guides in our documentation:

文章Article 说明Description
在事件中心镜像 Kafka 中转站Mirror a Kafka broker in an event hub 演示如何使用 Kafka MirrorMaker 在事件中心镜像 Kafka 中转站。Shows how to mirror a Kafka broker in an event hub using Kafka MirrorMaker.
将 Apache Spark 连接到事件中心Connect Apache Spark to an event hub 详细介绍如何将 Spark 应用程序连接到事件中心进行实时流式处理。Walks you through connecting your Spark application to Event Hubs for real-time streaming.
将 Apache Flink 连接到事件中心Connect Apache Flink to an event hub 演示如何在不更改你的协议客户端或运行你自己的群集的情况下,将 Apache Flink 连接到事件中心。Shows you how to connect Apache Flink to an event hub without changing your protocol clients or running your own clusters.
将 Apache Kafka Connect 与事件中心(预览版)集成Integrate Apache Kafka Connect with a event hub (Preview) 详细介绍如何将 Kafka Connect 与事件中心集成,以及如何部署基本的 FileStreamSource 和 FileStreamSink 连接器。Walks you through integrating Kafka Connect with an event hub and deploying basic FileStreamSource and FileStreamSink connectors.
将 Akka Streams 连接到事件中心Connect Akka Streams to an event hub 演示如何在不更改你的协议客户端或运行你自己的群集的情况下,将 Akka Streams 连接到事件中心。Shows you how to connect Akka Streams to an event hub without changing your protocol clients or running your own clusters.
将适用于 Apache Kafka 的 Spring Boot Starter 与 Azure 事件中心配合使用Use the Spring Boot Starter for Apache Kafka with Azure Event Hubs 介绍如何配置基于 Java 的 Spring Cloud Stream Binder,它是使用 Spring Boot Initializer 创建的,目的是将 Apache Kafka 与 Azure 事件中心配合使用。Demonstrates how to configure a Java-based Spring Cloud Stream Binder created with the Spring Boot Initializer to use Apache Kafka with Azure Event Hubs.

后续步骤Next steps

请查看 GitHub 存储库 azure-event-hubs-for-kafka 中 quickstart 和 tutorials 文件夹下的示例。Review samples in the GitHub repo azure-event-hubs-for-kafka under quickstart and tutorials folders.

另请参阅以下文章:Also, see the following articles: