0
votes

I have a Azure VM on which a windows service is installed.

In this windows service, we are registering to the EventHub like mentioned in this website.

I have method which logs error like this:

Task IEventProcessor.ProcessErrorAsync(PartitionContext context, Exception error)
{
    log.Error($"Error: {error.Message}");
    return Task.CompletedTask;
}

This windows service keeps listening to the event hub and when ever a event is received, it performs some processing based on the event (some business logic). When the processing is happening, it sometimes throws this error in between.

Error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

But there after some time, it resumes its processing as usual. So why do these error messages come and is it getting resolved by itself. This is not causing any issue for me but want to know the reason and want to avoid this in future completely if possible.I have searched a lot about this on net, couldn't find any proper solution.Any help is highly appreciated.

2
I know it is a little bit off topic but do you really need a windows service running on a VM ? You should have a look at azure functions and/or webjobs.Thomas
@Thomas There is one COM application running in the VM which the service needs to access.That is the reason we are using Windows service.CrazyCoder

2 Answers

0
votes

I think you should take a look at Azure Event Hubs quotas and limits and How exactly does Event Hubs Throttling Work?, as from your description of the problem, it might be possible you are hitting a throttling threshold.

Hope it helps!

0
votes

Adding to @ItayPodhajcer's answer.

Add a Retry Policy. It is very common to have transient connection errors in a cloud based services. Refer to the Service Bus Retry policy document here:

https://docs.microsoft.com/en-us/azure/architecture/best-practices/retry-service-specific#service-bus