EPOCH Error while communicating with Azure Event Hub EPOCH Error while communicating with Azure Event Hub azure azure

EPOCH Error while communicating with Azure Event Hub


It sounds like you are running two instances of the application, two concurrent classes, or two applications that use the same event hub consumer group. Event hub consumer groups are effectively pointers to a point in time on the event stream. If you try and use one consumer group with two instances of code, then you get a conflict like the one you are seeing.

Either:

  1. Ensure you only have a single instance reading the consumer group at a time.
  2. Use two consumer groups when you need two separate programs or sets of functionality to process the event hub at the same time.
  3. If you are looking to parallelize for performance, look in to event hub Partitioning and how to take advantage of processing each partition independently.

There is also an alternative scenario where an event hub partition is switched over to another host as part of the event hub's internal load balancing. In this case you may see the error you are receiving. In this case, just log it and continue on.

Here is some good documentation to help you on your way.