Receiving only one message from Azure Service Bus

Some time ago I got a question from Eto: “How would I go about this if I just want to receive one message only?” And I started thinking… is it possible in .Net Core? I used the newest Microsoft.Azure.ServiceBus package, that is dedicated for .Net Core, but there is no method to receive only one… Continue reading Receiving only one message from Azure Service Bus

Receiving messages from Azure Service Bus in .Net Core

For some time now we can observe how new .Net Core framework is growing and become more mature. Version 2.0 was released in August 2017 and it is more capable and supports more platforms then it’s previous releases. But the biggest feature of this brand new Microsoft framework is its performance and it’s ability to… Continue reading Receiving messages from Azure Service Bus in .Net Core

Getting messages from Service Bus queue

In the previous post I discussed how to implement sending messages. In this post I will show how to receive messages. The simplest code looks like this: static void GetMessage() { try { var queueClient = GetQueueClient(); var message = queueClient.Receive(); Console.WriteLine(“Received a message: ” + message.GetBody<string>()); } catch (Exception ex) { Console.WriteLine(“An exception occured:… Continue reading Getting messages from Service Bus queue

Sending messages to Azure Service Bus queue

To connect to Azure Service Bus you need to import nuget package: WindowsAzure.ServiceBus. Next step would be getting a connection string to your resource group. It can be found in Azure Portal, in Service Bus section. It should look like this: Copy connection string – primary key and paste it in App.config file. A key… Continue reading Sending messages to Azure Service Bus queue