There are two different .NET client libraries to work with Azure Service Bus:
This article mixes references to both of them and doesn't state explicitly that there are actually two different libraries so it's really hard to follow.
For example here:
> Service Bus client objects, such as _QueueClient_ or _MessageSender_, are created through a _MessagingFactory_ object.
_QueueClient_ and _MessageSender_ are from Microsoft.Azure.ServiceBus but _MessagingFactory_ is from WindowsAzure.ServiceBus which really doesn't make sense.
Also, the code examples are provided only for WindowsAzure.ServiceBus.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@inech Thank you for providing feedback. We will review this and provide an update as appropriate.
This documentation contains good information, but with sample code impossible to follow, thus it's very useless. Please update the library usage. I'm struggling to figure out how to make client-side batching with the Microsoft.Azure.ServiceBus library.
I agree with @inech. Particularly with the QueueClient and MessagingFactory. We're advised to use a factory but there isn't a factory class for the QueueClient from the "new" Microsoft.Azure.ServiceBus namespace. (Not that I can find). If we're to use a different pattern for keeping connections alive when using the components from the new namespace then please give full examples.
Very disappointed that MS still has not consolidated the article to exclusively use Microsoft.Azure.ServiceBus namespace.
I'm in a similar situation to @my-name-is .
I'd like to know the intended lifetimescope of the QueueClient and TopicClient.
This documentation is confusing as heck, with its mix of SDKs. It really needs to be rewritten to only talk about Microsoft.Azure.ServiceBus
I am still confused by the conflicting information. Can we at least get a reply to this thread on how to using a client factory with the new library? Or is one not needed?
Check out Sean Feldmans answer here...
https://stackoverflow.com/questions/51500645/should-azure-servicebusconnection-be-singleton
Following this advice, I share the connection object as a singleton but use a transient scope for the topic and subscription client.
Will this document ever be updated with the correct information? It is misleading.
Hi @IEvangelist,
thank you! Now the documentation is much more clear.
Most helpful comment
I agree with @inech. Particularly with the QueueClient and MessagingFactory. We're advised to use a factory but there isn't a factory class for the QueueClient from the "new" Microsoft.Azure.ServiceBus namespace. (Not that I can find). If we're to use a different pattern for keeping connections alive when using the components from the new namespace then please give full examples.