Reputation: 31
We have currently implemented this using WindowsAzure.ServiceBus
library. It is quite simple there as MessagingFactory
class does the job. We are now migrating to Microsoft.Azure.EventHubs
libraries. I wanted to know how we can achieve the same with Microsoft.Azure.EventHubs
. We need this because our application can create 100+ EventHubClient
objects at runtime.
Actual Scenario for more context to the question:
We want to use eventhubs using Microsoft.Azure.EventHubs library.
The scenario is that, our application can create a lot of eventhub clients during runtime. We don't want to create a new TCP connection each time a new eventhub client is created (our host VM has constraints on number of TCP connections we can use). Our current implementation creates a pool of 200 Microsoft.ServiceBus.Messaging.MessagingFactory objects and in a round-robin fashion creates new eventhub client from the MessagingFactory pool. This guarantees us that there will not be more than 200 TCP connections opened.
Now, we are migrating from Microsoft.ServiceBus.Messaging to Microsoft.Azure.EventHubs library since we felt we might get more support as Microsoft has specifically create this Microsoft.Azure.EventHubs for eventhubs solely.
The problem is that Microsoft.Azure.EventHubs do not have a MessagingFactory class. Nor is there any way we can provide a TCP connection object when creating an EventHub client. This has brought our work to a stall as we are unsure how to proceed from here. Any lead is appreciated.
Upvotes: 1
Views: 818
Reputation: 29850
Sometimes the answer to a question is just a plain "No". That is the case for this one as well. It (reusing the TCP connection) is currently not supported. There are literally no traces of this in the source repo.
That said, since the .NET Standard client library for Azure Event Hubs you could open an issue there and bring it to their attention (if it is not already on their roadmap somehow).
Upvotes: 3