I am using Azure Event Hub for listening to real-time data in my application. Most of the times, it works fine but sometimes it throws the following error -
New receiver with higher epoch of '3109' is created hence current receiver with epoch '3108' is getting disconnected. If you are recreating the receiver, make sure a higher epoch is used. TrackingId:eb2a6f970000494500f379f85b484a9f_C-1553490498_B22, SystemTracker:xxxxxxxxxx:eventhub:xxxxxxx~2730|$default, Timestamp:7/13/2018 6:48:54 AM.
and application stops processing data. I have gone through several articles on the net but not able to find any solution. On MSDN, I read
that EPH relies on the fact that "there can only be 1 active epoch receiver on a consumer group at any given time
but I am not sure how to ensure that there will be only 1 active epoch. Also, the same Event Hub is utilized by three different environments i.e. Development, Test, Production.
Any suggestions are highly appreciated..
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With