Azure-docs: Mixing Microsoft.Azure.ServiceBus and WindowsAzure.ServiceBus client libraries

Created on 13 Mar 2019  Â·  11Comments  Â·  Source: MicrosoftDocs/azure-docs

There are two different .NET client libraries to work with Azure Service Bus:

  • Microsoft.Azure.ServiceBus (newer, .net standard)
  • WindowsAzure.ServiceBus (older, only .net framework)

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.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 assigned-to-author doc-enhancement service-bus-messaginsvc triaged

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.

All 11 comments

@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 @inech,

I hope all is well, we've made changes to the doc to address your expressed concern. Please have a look again at the article and let me know if these are satisfactory enough to close this issue.

Merged here, updates to the doc are live here.

Hi @IEvangelist,

thank you! Now the documentation is much more clear.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JamesDLD picture JamesDLD  Â·  3Comments

AronT-TLV picture AronT-TLV  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

bityob picture bityob  Â·  3Comments

Favna picture Favna  Â·  3Comments