Search code examples
azure-sdk-.netevent-processor-host

Will two versions of Azure EventProcessor partition logic cause stalling?


Context

I have an event processing service running on n machines using the EventProcessorHost class from Microsoft.ServiceBus.Messaging.

Let's say I made upgrades to my service where I now use the modern Azure.Messaging.EventHubs.Processor's EventProcessor. This allows for even higher abstraction such that I can avoid bespoke partition management logic.

I want to test the upgrade in which I use the new EventProcessor and override 1 machine out of my n machines running legacy EventProcessorHost.

Problem

When I override 1 out of my n machines with the new EventProcessor, my processor enters a loop of starting and stopping reading from partitions. It never ends up receiving any event traffic.

Could it be that the legacy EventProcessorHost-based machines are taking ownership of the newly lost partitions such that my overridden machine never owns any partitions?

Question

Is it a known or common issue that I shouldn't be running two versions of partition ownership logic simultaneously since they will race each other and conflict? This seems to be the case since my overridden machines never actually get any event traffic.

Any help appreciated.


Solution

  • You cannot use the processor types from Azure.Messaging.EventHubs and the processor types from any of the legacy packages for the same Event Hub and Consumer Group pairing.

    Each generation of the Azure SDK takes a different approach to balancing the load and sharing work. Processors from different generations are not intended to coordinate and will, therefore, each fight for control and exclusive ownership of partitions.

    To test a new implementation, you'll want to create a new consumer group and run in that context.