Azure Service Bus In .NET Core 2.0


How to use Azure Service Bus in .NET Core.


Create a class library and add NuGet package - Microsoft.Azure.ServiceBus

Add a class to encapsulate settings.

Add a class to wrap functionality of sending messages to queue

Add a class to wrap the functionality of receiving messages from the queue.

Now, you can use these wrapper classes to send messages.

And receive messages.


The sample code also includes wrappers for topics and subscriptions.


The sample code will require you to setup Azure account and Service Bus. Instructions for these could be found here.

Source Code