Azure Event Hub ProcessorClient connection is not persistent with Azure.Messaging.EventHubs in Console App

Manikandan Balasubramanian 0 Reputation points Microsoft Employee
2021-10-20T18:56:46.733+00:00

Hi Team,

I am trying to receive events from Event Hub into my application(Console App - netcoreapp3.1) and I am using EventProcessorClient as given in the example listed here:
https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-dotnet-standard-getstarted-send

I am using blob storage client and EH connection. The library I am using is:
Azure.Messaging.EventHubs.Processor(5.6,2);
Azure.Messaging.EventHubs(5.6.2)

The EH connection is able to receive first few messages and then I am seeing that PartitionClosingHandler is getting called. When I print the error message, I am seeing the reason as shutdown.

Can you please let me know how to make this connection consistent?

Thanks and Regards,
Mani

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,157 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
556 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. HimanshuSinha-msft 19,376 Reputation points Microsoft Employee
    2021-10-21T21:17:17.543+00:00

    Hello anonymous user ,

    Thanks for the ask and using Microsoft Q&A platform .

    It may be due to rebalancing. How many clients are you trying to run at the same time ? If you are running with multiple clients then you should let the clients to reach a balanced state after which you should not see PartitionClosingHandler calls.

    And one more thing. I suggest better run the code with a brand new consumer group. Using default consumer group while it is already in use by other clients becomes an easy pitfall .

    Please do let me know how it goes .
    Thanks
    Himanshu

    -------------------------------------------------------------------------------------------------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

  2. Manikandan Balasubramanian 0 Reputation points Microsoft Employee
    2021-10-27T03:44:39.38+00:00

    Hi @HimanshuSinha-msft

    Thanks for your immediate response. I am using only one client to access this data; when I am testing in my local, I use a different EH consumer group.

    Is there any configuration setting that I can provide in EventProcessorClient that would make this connection persistent? Also I am trying this in the Console App.

    Regards,
    Mani

    0 comments No comments

  3. Manikandan Balasubramanian 0 Reputation points Microsoft Employee
    2021-11-03T06:43:20.823+00:00

    Gentle bump on this issue.

    0 comments No comments