Skip to content

Commit 43a2c0f

Browse files
committed
Kafka samples
1 parent b228d33 commit 43a2c0f

File tree

2 files changed

+36
-34
lines changed

2 files changed

+36
-34
lines changed

articles/event-hubs/event-hubs-for-kafka-ecosystem-overview.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: timlt
99
ms.service: event-hubs
1010
ms.topic: article
1111
ms.custom: seodec18
12-
ms.date: 12/06/2018
12+
ms.date: 02/12/2020
1313
ms.author: shvija
1414

1515
---
@@ -40,7 +40,9 @@ Scale in Event Hubs is controlled by how many throughput units you purchase, wit
4040

4141
### Security and authentication
4242

43-
Azure Event Hubs requires SSL or TLS for all communication and uses Shared Access Signatures (SAS) for authentication. This requirement is also true for a Kafka endpoint within Event Hubs. For compatibility with Kafka, Event Hubs uses SASL PLAIN for authentication and SASL SSL for transport security. For more information about security in Event Hubs, see [Event Hubs authentication and security](event-hubs-authentication-and-security-model-overview.md).
43+
Azure Event Hubs requires SSL or TLS for all communication and uses Open Authentication (OAuth) or Shared Access Signatures (SAS) for authentication. This requirement is also true for a Kafka endpoint within Event Hubs. For compatibility with Kafka, Event Hubs uses SASL PLAIN or OAUTHBEARER for authentication and SASL SSL for transport security. For more information about security in Event Hubs, see [Event Hubs authentication and security](event-hubs-authentication-and-security-model-overview.md).
44+
45+
For samples that show how to use OAuth with Event Hubs for Kafka, see [samples on GitHub](https://github.com/Azure/azure-event-hubs-for-kafka/tree/master/tutorials/oauth).
4446

4547
## Other Event Hubs features available for Kafka
4648

articles/event-hubs/event-hubs-quickstart-kafka-enabled-event-hubs.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.author: shvija
77
ms.service: event-hubs
88
ms.topic: quickstart
99
ms.custom: seodec18
10-
ms.date: 11/05/2019
10+
ms.date: 02/12/2020
1111
---
1212

1313
# Quickstart: Data streaming with Event Hubs using the Kafka protocol
@@ -28,28 +28,7 @@ To complete this quickstart, make sure you have the following prerequisites:
2828
* [A Kafka enabled Event Hubs namespace](event-hubs-create.md)
2929

3030
## Create a Kafka enabled Event Hubs namespace
31-
32-
1. Sign in to the [Azure portal](https://portal.azure.com), and click **Create a resource** at the top left of the screen.
33-
34-
2. Search for Event Hubs and select the options shown here:
35-
36-
![Search for Event Hubs in the portal](./media/event-hubs-create-kafka-enabled/event-hubs-create-event-hubs.png)
37-
38-
3. Provide a unique name and enable Kafka on the namespace. Click **Create**. Note: Event Hubs for Kafka is only supported by Standard and Dedicated tier Event Hubs. Basic tier Event Hubs will return a Topic Authorization Error in response to any Kafka operations.
39-
40-
![Create a namespace](./media/event-hubs-create-kafka-enabled/create-kafka-namespace.jpg)
41-
42-
4. Once the namespace is created, on the **Settings** tab click **Shared access policies** to get the connection string.
43-
44-
![Click Shared access policies](./media/event-hubs-create/create-event-hub7.png)
45-
46-
5. You can choose the default **RootManageSharedAccessKey**, or add a new policy. Click the policy name and copy the connection string.
47-
48-
![Select a policy](./media/event-hubs-create/create-event-hub8.png)
49-
50-
6. Add this connection string to your Kafka application configuration.
51-
52-
You can now stream events from your applications that use the Kafka protocol into Event Hubs.
31+
When you create a standard tier Event Hubs namespace, the Kafka endpoint for the namespace is automatically enabled. You can stream events from your applications that use the Kafka protocol into standard tier Event Hubs. It's not enabled for the basic tier Event Hubs namespace.
5332

5433
## Send and receive messages with Kafka in Event Hubs
5534

@@ -59,13 +38,23 @@ You can now stream events from your applications that use the Kafka protocol int
5938

6039
3. Update the configuration details for the producer in `src/main/resources/producer.config` as follows:
6140

41+
**SSL:**
42+
6243
```xml
63-
bootstrap.servers={YOUR.EVENTHUBS.FQDN}:9093
44+
bootstrap.servers=NAMESPACENAME.servicebus.windows.net:9093
6445
security.protocol=SASL_SSL
6546
sasl.mechanism=PLAIN
6647
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="{YOUR.EVENTHUBS.CONNECTION.STRING}";
6748
```
68-
49+
**OAuth:**
50+
51+
```xml
52+
bootstrap.servers=NAMESPACENAME.servicebus.windows.net:9093
53+
security.protocol=SASL_SSL
54+
sasl.mechanism=OAUTHBEARER
55+
sasl.jaas.config=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required;
56+
sasl.login.callback.handler.class=class CustomAuthenticateCallbackHandler;
57+
```
6958
4. Run the producer code and stream into Kafka-enabled Event Hubs:
7059

7160
```shell
@@ -77,13 +66,24 @@ You can now stream events from your applications that use the Kafka protocol int
7766

7867
6. Update the configuration details for the consumer in `src/main/resources/consumer.config` as follows:
7968

69+
**SSL:**
70+
8071
```xml
81-
bootstrap.servers={YOUR.EVENTHUBS.FQDN}:9093
72+
bootstrap.servers=NAMESPACENAME.servicebus.windows.net:9093
8273
security.protocol=SASL_SSL
8374
sasl.mechanism=PLAIN
8475
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="{YOUR.EVENTHUBS.CONNECTION.STRING}";
8576
```
8677

78+
**OAuth:**
79+
80+
```xml
81+
bootstrap.servers=NAMESPACENAME.servicebus.windows.net:9093
82+
security.protocol=SASL_SSL
83+
sasl.mechanism=OAUTHBEARER
84+
sasl.jaas.config=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required;
85+
sasl.login.callback.handler.class=class CustomAuthenticateCallbackHandler;
86+
```
8787
7. Run the consumer code and process from Kafka enabled Event Hubs using your Kafka clients:
8888

8989
```java
@@ -94,10 +94,10 @@ You can now stream events from your applications that use the Kafka protocol int
9494
If your Event Hubs Kafka cluster has events, you now start receiving them from the consumer.
9595

9696
## Next steps
97-
In this article, you learned how to stream into Kafka-enabled Event Hubs without changing your protocol clients or running your own clusters. To learn more, continue with the following tutorial:
97+
In this article, you learned how to stream into Kafka-enabled Event Hubs without changing your protocol clients or running your own clusters. To learn more, see the following articles and samples:
9898

99-
* [Learn about Event Hubs](event-hubs-what-is-event-hubs.md)
100-
* [Learn about Event Hubs for Kafka](event-hubs-for-kafka-ecosystem-overview.md)
101-
* [Explore more samples on the Event Hubs for Kafka GitHub](https://github.com/Azure/azure-event-hubs-for-kafka)
102-
* Use [MirrorMaker](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=27846330) to [stream events from Kafka on premises to Kafka enabled Event Hubs on cloud.](event-hubs-kafka-mirror-maker-tutorial.md)
103-
* Learn how to stream into Kafka enabled Event Hubs using [Apache Flink](event-hubs-kafka-flink-tutorial.md) or [Akka Streams](event-hubs-kafka-akka-streams-tutorial.md)
99+
- [Learn about Event Hubs for Kafka](event-hubs-for-kafka-ecosystem-overview.md)
100+
- [Quickstarts for Event Hubs for Kafka on GitHub](https://github.com/Azure/azure-event-hubs-for-kafka/tree/master/quickstart)
101+
- [Tutorials for Event Hubs for Kafka on GitHub](https://github.com/Azure/azure-event-hubs-for-kafka/tree/master/tutorials)
102+
- Use [MirrorMaker](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=27846330) to [stream events from Kafka on premises to Kafka enabled Event Hubs on cloud.](event-hubs-kafka-mirror-maker-tutorial.md)
103+
- Learn how to stream into Kafka enabled Event Hubs using [Apache Flink](event-hubs-kafka-flink-tutorial.md) or [Akka Streams](event-hubs-kafka-akka-streams-tutorial.md)

0 commit comments

Comments
 (0)