Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

[EventHub] Explicit call to close required: bug or wrong usage?

$
0
0

Hi everyone,

I have a simple web app that, on each request, send an event through an EventHub in order to process it later (for now with a Stream Analytics in order to get some "quick win aggregation"). I precise that, for each request, a new EventHubClient object is instanciated.

After running the app some times, I identified that the EventHub stopped to receive any events. Diving into logs, I found an exception thrown by the webapp on a call to theEventHubClient::SendAsync() method. The reason was something like "AMQP error: cannot register more than 4999 handlers"

To solve that issue, I just added a call to the EventHubClient::close() method at the end of my request. But the thing is, neither in the MSDN documentation neither in Azure Documenation (or here) a requirement to call that method is mentionned.

So some questions:

  • Is it normal that the EventHubClient doesn't "close itself" alone?
  • Do you see any drawback to close the EventHubClient instance manually? On each request?
  • I instanciate a new EventHubClient object on each request beacause MSDN documentation precise that EventHubClient's methods are not thread safe. Do you see any counterpart on that except maybe some additionnal time consuming for each request? I thought about implementing a kind of PoolOfEventHubClient that I would share between requests... do you think it might be really relevant?

Many thanks for your lights,


Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>