Skip to content

Commit 259c0dc

Browse files
Merge pull request #266477 from spelluru/ehubfreshness0215
Event Hubs freshness review
2 parents b94612f + f2abf96 commit 259c0dc

12 files changed

+69
-290
lines changed

articles/event-hubs/.openpublishing.redirection.event-hubs.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"redirections": [
3+
{
4+
"source_path": "event-hubs-event-processor-host.md",
5+
"redirect_url": "/azure/event-hubs/event-processor-balance-partition-load",
6+
"redirect_document_id": false
7+
},
38
{
49
"source_path": "use-blob-storage-checkpoint-store-azure-stack-hub.md",
510
"redirect_url": "/azure/event-hubs/troubleshoot-checkpoint-store-issues",

articles/event-hubs/TOC.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,9 @@
123123
href: schema-registry-concepts.md
124124
- name: Client-side schema enforcement
125125
href: schema-registry-client-side-enforcement.md
126-
- name: Event processing using SDKs
126+
- name: Event processing
127127
items:
128-
- name: Event processor host (legacy SDK)
129-
href: event-hubs-event-processor-host.md
130-
- name: Event processor (latest SDK)
128+
- name: Event processor
131129
href: event-processor-balance-partition-load.md
132130
- name: Event processing with no code editor
133131
href: ../stream-analytics/no-code-stream-processing.md?toc=/azure/event-hubs/toc.json

articles/event-hubs/dynamically-add-partitions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Event Hubs provides three sender options:
6969
- **Round-robin sender (default)** – In this scenario, the Event Hubs service round robins the events across partitions, and also uses a load-balancing algorithm. Event Hubs service is aware of partition count changes and will send to new partitions within seconds of altering partition count.
7070

7171
### Receiver/consumer clients
72-
Event Hubs provides direct receivers and an easy consumer library called the [Event Processor Host (old SDK)](event-hubs-event-processor-host.md) or [Event Processor (new SDK)](event-processor-balance-partition-load.md).
72+
Event Hubs provides direct receivers and an easy consumer library called the [Event Processor](event-processor-balance-partition-load.md).
7373

7474
- **Direct receivers** – The direct receivers listen to specific partitions. Their runtime behavior isn't affected when partitions are scaled out for an event hub. The application that uses direct receivers needs to take care of picking up the new partitions and assigning the receivers accordingly.
7575
- **Event processor host** – This client doesn't automatically refresh the entity metadata. So, it wouldn't pick up on partition count increase. Recreating an event processor instance will cause an entity metadata fetch, which in turn will create new blobs for the newly added partitions. Pre-existing blobs won't be affected. Restarting all event processor instances is recommended to ensure that all instances are aware of the newly added partitions, and load-balancing is handled correctly among consumers.

articles/event-hubs/event-hubs-c-getstarted-send.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Congratulations! You have now sent messages to an event hub.
152152
## Next steps
153153
Read the following articles:
154154
155-
- [EventProcessorHost](event-hubs-event-processor-host.md)
155+
- [Event processor](event-processor-balance-partition-load.md)
156156
- [Features and terminology in Azure Event Hubs](event-hubs-features.md).
157157
158158

articles/event-hubs/event-hubs-event-processor-host.md

Lines changed: 0 additions & 202 deletions
This file was deleted.

articles/event-hubs/event-hubs-features.md

Lines changed: 23 additions & 44 deletions
Large diffs are not rendered by default.

articles/event-hubs/event-hubs-java-get-started-send.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Send or receive events from Azure Event Hubs using Java (latest)
33
description: This article provides a walkthrough of creating a Java application that sends/receives events to/from Azure Event Hubs.
44
ms.topic: quickstart
5-
ms.date: 02/10/2023
5+
ms.date: 02/16/2024
66
ms.devlang: java
77
ms.custom: devx-track-java, mode-api, passwordless-java, devx-track-extended-java
88
---
@@ -20,7 +20,7 @@ If you're new to Azure Event Hubs, see [Event Hubs overview](event-hubs-about.md
2020

2121
To complete this quickstart, you need the following prerequisites:
2222

23-
- **Microsoft Azure subscription**. To use Azure services, including Azure Event Hubs, you need a subscription. If you don't have an existing Azure account, you can sign up for a [free trial](https://azure.microsoft.com/free/) or use your MSDN subscriber benefits when you [create an account](https://azure.microsoft.com).
23+
- **Microsoft Azure subscription**. To use Azure services, including Azure Event Hubs, you need a subscription. If you don't have an existing Azure account, you can sign up for a [free trial](https://azure.microsoft.com/free/) or use your MSDN subscriber benefits when you [create an account](https://azure.microsoft.com).
2424
- A Java development environment. This quickstart uses [Eclipse](https://www.eclipse.org/). Java Development Kit (JDK) with version 8 or above is required.
2525
- **Create an Event Hubs namespace and an event hub**. The first step is to use the [Azure portal](https://portal.azure.com) to create a namespace of type Event Hubs, and obtain the management credentials your application needs to communicate with the event hub. To create a namespace and an event hub, follow the procedure in [this article](event-hubs-create.md). Then, get the **connection string for the Event Hubs namespace** by following instructions from the article: [Get connection string](event-hubs-get-connection-string.md#azure-portal). You use the connection string later in this quickstart.
2626

@@ -38,12 +38,12 @@ First, create a new **Maven** project for a console/shell application in your fa
3838
<dependency>
3939
<groupId>com.azure</groupId>
4040
<artifactId>azure-messaging-eventhubs</artifactId>
41-
<version>5.15.0</version>
41+
<version>5.18.0</version>
4242
</dependency>
4343
<dependency>
4444
<groupId>com.azure</groupId>
4545
<artifactId>azure-identity</artifactId>
46-
<version>1.8.0</version>
46+
<version>1.11.2</version>
4747
<scope>compile</scope>
4848
</dependency>
4949
```
@@ -54,7 +54,7 @@ First, create a new **Maven** project for a console/shell application in your fa
5454
<dependency>
5555
<groupId>com.azure</groupId>
5656
<artifactId>azure-messaging-eventhubs</artifactId>
57-
<version>5.15.0</version>
57+
<version>5.18.0</version>
5858
</dependency>
5959
```
6060

@@ -233,7 +233,7 @@ Follow these steps to create an Azure Storage account.
233233

234234
## [Connection String](#tab/connection-string)
235235

236-
[Get the connection string to the storage account](../storage/common/storage-configure-connection-string.md)
236+
[Get the connection string to the storage account](../storage/common/storage-configure-connection-string.md).
237237

238238
Note down the **connection string** and the **container name**. You use them in the receive code.
239239

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

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: 'Quickstart: Use Apache Kafka with Azure Event Hubs'
33
description: 'This quickstart shows you how to stream data into and from Azure Event Hubs using the Apache Kafka protocol.'
44
ms.topic: quickstart
5-
ms.date: 02/07/2023
5+
ms.date: 02/16/2024
66
author: spelluru
77
ms.author: spelluru
88
ms.custom: mode-other, passwordless-java
@@ -96,10 +96,8 @@ Azure Event Hubs supports using Microsoft Entra ID to authorize requests to Even
9696
### [Connection string](#tab/connection-string)
9797

9898
1. Clone the [Azure Event Hubs for Kafka repository](https://github.com/Azure/azure-event-hubs-for-kafka).
99-
100-
1. Navigate to *azure-event-hubs-for-kafka/quickstart/java/producer*.
101-
102-
1. Update the configuration details for the producer in *src/main/resources/producer.config* as follows:
99+
1. Navigate to *azure-event-hubs-for-kafka/quickstart/java/consumer*.
100+
1. Update the configuration details for the consumer in *src/main/resources/consumer.config* as follows:
103101

104102
```xml
105103
bootstrap.servers=NAMESPACENAME.servicebus.windows.net:9093
@@ -110,17 +108,14 @@ Azure Event Hubs supports using Microsoft Entra ID to authorize requests to Even
110108

111109
> [!IMPORTANT]
112110
> Replace `{YOUR.EVENTHUBS.CONNECTION.STRING}` with the connection string for your Event Hubs namespace. For instructions on getting the connection string, see [Get an Event Hubs connection string](event-hubs-get-connection-string.md). Here's an example configuration: `sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="Endpoint=sb://mynamespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=XXXXXXXXXXXXXXXX";`
111+
1. Run the consumer code and process events from event hub using your Kafka clients:
113112

114-
1. Run the producer code and stream events into Event Hubs:
115-
116-
```shell
113+
```java
117114
mvn clean package
118-
mvn exec:java -Dexec.mainClass="TestProducer"
115+
mvn exec:java -Dexec.mainClass="TestConsumer"
119116
```
120-
121-
1. Navigate to *azure-event-hubs-for-kafka/quickstart/java/consumer*.
122-
123-
1. Update the configuration details for the consumer in *src/main/resources/consumer.config* as follows:
117+
1. Navigate to *azure-event-hubs-for-kafka/quickstart/java/producer*.
118+
1. Update the configuration details for the producer in *src/main/resources/producer.config* as follows:
124119

125120
```xml
126121
bootstrap.servers=NAMESPACENAME.servicebus.windows.net:9093
@@ -131,12 +126,11 @@ Azure Event Hubs supports using Microsoft Entra ID to authorize requests to Even
131126

132127
> [!IMPORTANT]
133128
> Replace `{YOUR.EVENTHUBS.CONNECTION.STRING}` with the connection string for your Event Hubs namespace. For instructions on getting the connection string, see [Get an Event Hubs connection string](event-hubs-get-connection-string.md). Here's an example configuration: `sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="Endpoint=sb://mynamespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=XXXXXXXXXXXXXXXX";`
129+
1. Run the producer code and stream events into Event Hubs:
134130

135-
1. Run the consumer code and process events from event hub using your Kafka clients:
136-
137-
```java
131+
```shell
138132
mvn clean package
139-
mvn exec:java -Dexec.mainClass="TestConsumer"
133+
mvn exec:java -Dexec.mainClass="TestProducer"
140134
```
141135

142136
If your Event Hubs Kafka cluster has events, you'll now start receiving them from the consumer.

articles/event-hubs/event-processor-balance-partition-load.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.date: 11/14/2022
77

88
# Balance partition load across multiple instances of your application
99

10-
To scale your event processing application, you can run multiple instances of the application and have the load balanced among themselves. In the older versions, [EventProcessorHost](event-hubs-event-processor-host.md) allowed you to balance the load between multiple instances of your program and checkpoint events when receiving the events. In the newer versions (5.0 onwards), **EventProcessorClient** (.NET and Java), or **EventHubConsumerClient** (Python and JavaScript) allows you to do the same. The development model is made simpler by using events. You subscribe to the events that you're interested in by registering an event handler. If you're using the old version of the client library, see the following migration guides: [.NET](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/eventhub/Azure.Messaging.EventHubs/MigrationGuide.md), [Java](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/servicebus/azure-messaging-servicebus/migration-guide.md), [Python](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/servicebus/azure-servicebus/migration_guide.md), and [JavaScript](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/servicebus/service-bus/migrationguide.md).
10+
To scale your event processing application, you can run multiple instances of the application and have the load balanced among themselves. In the older and deprecated versions, `EventProcessorHost` allowed you to balance the load between multiple instances of your program and checkpoint events when receiving the events. In the newer versions (5.0 onwards), **EventProcessorClient** (.NET and Java), or **EventHubConsumerClient** (Python and JavaScript) allows you to do the same. The development model is made simpler by using events. You can subscribe to the events that you're interested in by registering an event handler. If you're using the old version of the client library, see the following migration guides: [.NET](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/eventhub/Azure.Messaging.EventHubs/MigrationGuide.md), [Java](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/servicebus/azure-messaging-servicebus/migration-guide.md), [Python](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/servicebus/azure-servicebus/migration_guide.md), and [JavaScript](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/servicebus/service-bus/migrationguide.md).
1111

1212
This article describes a sample scenario for using multiple instances of client `applications to read events from an event hub. It also gives you details about features of event processor client, which allows you to receive events from multiple partitions at once and load balance with other consumers that use the same event hub and consumer group.
1313

@@ -22,7 +22,7 @@ Each sensor pushes data to an event hub. The event hub is configured with 16 par
2222

2323
## Consumer application
2424

25-
When designing the consumer in a distributed environment, the scenario must handle the following requirements:
25+
When you design a consumer in a distributed environment, the scenario must handle the following requirements:
2626

2727
1. **Scale:** Create multiple consumers, with each consumer taking ownership of reading from a few Event Hubs partitions.
2828
2. **Load balance:** Increase or reduce the consumers dynamically. For example, when a new sensor type (for example, a carbon monoxide detector) is added to each home, the number of events increases. In that case, the operator (a human) increases the number of consumer instances. Then, the pool of consumers can rebalance the number of partitions they own, to share the load with the newly added consumers.
@@ -58,7 +58,7 @@ Each event processor instance acquires ownership of a partition and starts proce
5858

5959
## Receive messages
6060

61-
When you create an event processor, you specify functions that will process events and errors. Each call to the function that processes events delivers a single event from a specific partition. It's your responsibility to handle this event. If you want to make sure the consumer processes every message at least once, you need to write your own code with retry logic. But be cautious about poisoned messages.
61+
When you create an event processor, you specify functions that process events and errors. Each call to the function that processes events delivers a single event from a specific partition. It's your responsibility to handle this event. If you want to make sure the consumer processes every message at least once, you need to write your own code with retry logic. But be cautious about poisoned messages.
6262

6363
We recommend that you do things relatively fast. That is, do as little processing as possible. If you need to write to storage and do some routing, it's better to use two consumer groups and have two event processors.
6464

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: include file
3-
description: include file
2+
title: Event Hubs partition overview
3+
description: Provides a description of a partition in Azure Event Hubs.
44
author: spelluru
55
ms.service: event-hubs
66
ms.topic: include
@@ -10,6 +10,6 @@ ms.custom: "include file"
1010

1111
---
1212

13-
As [partition](../event-hubs-features.md#partitions) is a data organization mechanism that allows you to publish and consume data in a parallel manner, we recommend that you balance scaling units (TUs, PUs or CUs) and partitions to achieve optimal scale. In general, we recommend a maximum throughput of 1 MB/s per partition. Therefore, a rule of thumb for calculating the number of partitions would be to divide the maximum expected throughput by 1 MB/s. For example, if your use case requires 20 MB/s, it is recommended to choose at least 20 partitions to achieve the optimal throughput.
13+
As [partition](../event-hubs-features.md#partitions) is a data organization mechanism that allows you to publish and consume data in a parallel manner. We recommend that you balance scaling units (throughput units for the standard tier, processing units for the premium tier, or capacity units for the dedicated tier) and partitions to achieve optimal scale. In general, we recommend a maximum throughput of 1 MB/s per partition. Therefore, a rule of thumb for calculating the number of partitions would be to divide the maximum expected throughput by 1 MB/s. For example, if your use case requires 20 MB/s, we recommend that you choose at least 20 partitions to achieve the optimal throughput.
1414

15-
However, if you have a model in which your application has an affinity to a particular partition, increasing the number of partitions may not be beneficial. For more information, see [availability and consistency](../event-hubs-availability-and-consistency.md).
15+
However, if you have a model in which your application has an affinity to a particular partition, increasing the number of partitions isn't beneficial. For more information, see [availability and consistency](../event-hubs-availability-and-consistency.md).

0 commit comments

Comments
 (0)