Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure event hub connection is closed error #420

Open
meteor1016 opened this issue Nov 12, 2021 · 1 comment
Open

Azure event hub connection is closed error #420

meteor1016 opened this issue Nov 12, 2021 · 1 comment

Comments

@meteor1016
Copy link

I see something like the following error while using azure event hub to send event message. But as I see in the azure portal, the metric shows that the event message is sent to the event hub.

" Error{condition=amqp:connection:forced, description='The connection was inactive for more than the allowed 300000 milliseconds and is closed by container 'LinkTracker'. TrackingId:00000000000000000000000000000000000_G21, SystemTracker:gateway5, Timestamp:2019-03-06T17:32:00', info=null} "

As I read from the azure doc (https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-amqp-troubleshoot), it said "You see the following error on the AMQP connection when all links in the connection have been closed because there was no activity (idle) and a new link hasn't been created in 5 minutes."

The doc also said "You can avoid them by making send/receive calls on the connection/link, which automatically recreates the connection/link."

On another similar reported issue in #280, it appears that the above error log is only a reflection that the connection is being automatically closed, and so it is not actually an error.

On the other hand, I once tried that if I call the close() method in EventHubProducerClient (by refer to sample code in https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-java-get-started-send), this error seems not appear again.

However, if doing so, when every time need to send the event, it will mean need to create a new EventHubProducerClient. I'm not sure if this may create another problem (like time required to create the new EventHubProducerClient, and memory consumption) if creating a new EventHubProducerClient for every send event, as there can be many events to send.

So I would like to know, will the above error lead to any issue ?

And what should be the best practice regarding the use of EventHubProducerClient, is it to create a new EventHubProducerClient for every event sending ?

@sharmando
Copy link

#280 (comment)

It is a bug. However, yes: Creating and closing the producer each time you need it is a simple workaround. Not ideal, not the best at scale, but it will allow the system to work past a few minutes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants