plasne / fixed-partitioned-event-hub

A custom Event Hub processor that supports a fixed set of partitions, batch processing, and checkpointing.
MIT License
0 stars 0 forks source link

Optimize ClaimOwnership #3

Open plasne opened 1 year ago

plasne commented 1 year ago

"The way that ownership is handled will cause the processor's load balancing loop to always attempt to manage claims, which provides no value and just eats cycles. Better to have list ownership, claim ownership, and list partitions return the same exact set so that load balancing believes that it is the only processor in the group and no-ops."

That is probably true, but I cannot imagine many cycles are burned just calculating requested ownership. Still, look at this example: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample08_CustomEventProcessor.md#static-partition-assignment

...maybe there is a way do this better.