-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Event Hubs Client] Load Balancer Options #13047
Conversation
ca48901
to
c223fea
Compare
@@ -13,6 +13,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", | |||
EndProject | |||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{797FF941-76FD-45FD-AC17-A73DFE2BA621}" | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Messaging.EventHubs", "..\Azure.Messaging.EventHubs\src\Azure.Messaging.EventHubs.csproj", "{65ECFE8C-4D8C-454B-AC63-4559FBE5AF7A}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is temporary until the Event Hubs core package is shipped and we can return to a package dependency.
c223fea
to
c36446c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - I just added some minor questions and suggestions.
sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/EventProcessorClient.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/EventProcessorClientOptions.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/src/Consumer/EventHubConsumerClient.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/src/Processor/LoadBalancingStrategy.cs
Outdated
Show resolved
Hide resolved
The focus of these changes is to allow for additional options to control load balancing within the event processor types set the stage for implementing different strategies for load balancing. Also included are surfacing options within the consumer client to allow tuning the prefetch count and batch size, to allow performance tuning.
c36446c
to
4a462e5
Compare
@@ -538,15 +537,17 @@ await foreach (var partitionEvent in eventChannel.Reader.EnumerateChannel(option | |||
// Determine the partitions for the Event Hub and create the shared channel. | |||
|
|||
var partitions = await GetPartitionIdsAsync(cancellationToken).ConfigureAwait(false); | |||
eventChannel = CreateEventChannel((BackgroundPublishReceiveBatchSize * partitions.Length * 2)); | |||
|
|||
var channelSize = options.CacheEventCount * partitions.Length * 2L; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is not performance-critical and we advise not calling it for production scenarios. The potential for having a smaller channel size than is ideal for very large values is not a concern.
@@ -391,8 +388,10 @@ public virtual async Task<string[]> GetPartitionIdsAsync(CancellationToken cance | |||
|
|||
try | |||
{ | |||
eventChannel = CreateEventChannel((BackgroundPublishReceiveBatchSize * 4)); | |||
cancelPublishingAsync = await PublishPartitionEventsToChannelAsync(partitionId, startingPosition, options.TrackLastEnqueuedEventProperties, options.OwnerLevel, eventChannel, cancellationSource).ConfigureAwait(false); | |||
var channelSize = options.CacheEventCount * 4L; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is due to be restructured to not make use of the background publishing channel before release; the overflow protection here is temporary.
The focus of these changes is to allow for additional options to control load balancing within the event processor types set the stage for implementing different strategies for load balancing. Also included are surfacing options within the consumer client to allow tuning the prefetch count and batch size, to allow performance tuning.
Summary
The focus of these changes is to allow for additional options to control load balancing within the event processor types set the stage for implementing
different strategies for load balancing. Also included are surfacing options within the consumer client to allow tuning the prefetch count and batch size, to allow performance tuning.
Note: The associated API changes were reviewed and approved by the architecture board. Tags have been curated to reflect that.
Last Upstream Rebase
Friday, June 26, 1:22pm (EDT)
References and Related Issues