Home » Java » java – two event processor hosts registered on the same event hub-Exceptionshub

java – two event processor hosts registered on the same event hub-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment

Questions:

I’m new on Azure services and I’m trying to learn the Event Hub.
I want to use the Event Hub as a fifo queue across multiple consumer. But I have some problems with lease management.
I have deployed two instances of my eph and I want use the same consumer group.
First of all I try the solution with only one instance and it’s ok.
When I deploy the event processor host on another machine, I see that the first one eph loses the connection

com.microsoft.azure.eventhubs.ReceiverDisconnectedException

Is It correct that two event processor hosts read from the same consumer group? Or this is the problem?
Can you suggest me any idea to approach or any improvement?

Thank you in advance!

How to&Answers:

When you deploy second processor host, it will attempt to own half of the leases for load balancing purpose. During balancing attempt, it is OK for other host to observe some intermittent failures like LeaseLostExceptions and ReceiverDisconnectedExceptions. You should not see any failures after couple minutes or after both hosts reach a balanced state.

See https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-event-processor-host for more details.