Exercise 5 – sending and receiving messages to and from a topic
In this section, we will create a topic and a Service Bus subscription to that topic using the Azure portal. Then, we will implement a .NET console application to send a set of messages to this topic and receive them from the subscription.
Creating a topic using the Azure portal
To create a topic in Azure Service Bus using the Azure portal, we follow these steps:
- Open your Service Bus namespace page and select Topics from the left-hand menu.
- Click the + Topic button to add a new topic as presented in the following screenshot:
Figure 3.29 – Add a topic to your Service Bus namespace
- A new dialog window will be displayed. Enter a name for the topic, such as
mytopic
, and leave the default values for the other options. - Select Create to confirm the topic creation.
Now that we’ve created a new topic, let’s create a subscription to...