Service Bus Topic Subscription
  • 13 Dec 2022
  • 4 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Service Bus Topic Subscription

  • Dark
    Light
  • PDF

Article Summary

Introduction

Service Bus is a messaging service provided by Azure to interconnect applications and services running within a cloud or on-premises solution. It is therefore a component available in any cloud architecture built with Azure.

The Service Bus Topic provides one-to-many communication between the applications. Cerebrata supports the following operations on the Service Bus Topic Subscriptions.

View Messages

One of the major challenges in Service Bus is viewing the messages in the topic subscriptions. Cerebrata solves this challenge by allowing the users to view both the active and dead-letter messages in the topic subscription. The messages can be viewed either in peek mode or peek lock mode.
The below illustration shows viewing the messages in a topic subscription.

Topic-Subscription-View-Messages

Peek messages by Sequence Number

When there are multiple messages in a topic subscription, there may be a need to peek at the messages from a particular sequence number. This can be achieved in Cerebrata by peeking at the messages from the required sequence number.
The below illustration shows peeking at the messages from the given sequence number in a topic subscription.

Topic-Subscription-Peek-By-Sequence-Number

Filter messages by Dead-Letter reason

Messages in a queue can be dead-lettered due to multiple reasons. Cerebrata helps us in filtering the received messages based on the dead-letter reason.
The below illustration shows filtering the messages in a dead-letter end based on the dead-letter reason.

Topic-Subscription-Filter-DeadLetter-Messages

Resubmit messages

Messages in the topic subscription may get dead-lettered due to multiple reasons based on the use cases. So, there will be a need to reprocess the messages that are in the dead-letter end by resubmitting them. Cerebrata helps in reprocessing the messages by resubmitting the messages to the same topic subscription or any other queue or topic in the same namespace to which the source topic subscription belongs.
The below illustration shows the resubmission of messages from a topic subscription.

Topic-Subscription-Resubmit-Messages

Modify and resubmit the message

Cerebrata also helps us in modifying the message content along with its properties like custom properties based on the data types, label, and resubmitting it to the same topic subscription. The original message can also be deleted if the message is received in peek-lock mode.
The below illustration shows the modification and resubmission of a message in a topic subscription.

Messages received with date time custom properties will appear as an epoch timestamp value.

ModifyandResubmittopics

Unlock and Renew the lock

The time taken to process the messages vary based on the scenario. So, it may be required to renew the lock of some messages so that you can have some additional time to process those messages. There may be cases, the message can be unlocked even before its lock gets expired. Cerebrata helps us in performing the above operations with ease.
The below illustration shows how to renew the lock and unlock the messages received in peek-lock mode.

Topic-Subscription-Unlock-RenewLock-messages

Delete messages

Messages can also be deleted from Service Bus Topic Subscription when the messages are received in peek-lock mode. This operation will be useful when there are invalid messages in the dead-letter end of the topic subscription.
The below illustration shows how to delete the messages received in peek-lock mode.

Topic-Subscription-Delete-messages

Purge messages

It is also possible to delete all the active and dead-letter messages in the Topic Subscription based on our business requirements.
The below illustration shows how to purge the messages in a topic subscription.

Topic-Subscription-Purge-messages

Monitor subscription

Cerebrata helps us visualize the behavior of applications sending and receiving messages from the topic and topic subscription in real time through Monitor. It is also possible to configure the refresh frequency so that the data shown is more realistic.
The below illustration shows how to monitor the messages in a topic subscription.

Topic-Subscription-Monitor

Add Topic Subscription

As a first step in developing a Cloud architecture, it is often necessary to create topic subscriptions with different properties to implement the required functionalities. Cerebrata makes this possible.

Service Bus Topic Subscription can be created with properties such as Requires Session, Enable Batch operations, Enable Message Ordering, Enable Requires Duplicate Detection, etc.

The below illustration shows adding a Service Bus Topic Subscription with the required properties.

Topic-Subscription-Create

View Properties

It can be difficult to remember the properties of a topic subscription when there are multiple topic subscriptions in a Namespace with different properties. Cerebrata allows us to view the properties of a Topic Subscription in order to overcome the above challenge.

The below illustration shows how to view the properties of a Topic Subscription.

Topic-Subscription-ViewProperties

Message count

In a topic subscription, messages can be active, dead-letter, transferred, or scheduled. Cerebrata helps us visualize the message count in a topic subscription to get a better understanding of the messages in the topic subscription.

The below illustration shows how to view the count of messages in a Topic Subscription.

Topic-Subscription-Message-Count

Update Topic Subscription

It is common to update certain properties of the Topic Subscription like the max delivery count of the messages, the destination for auto-forwarding active messages, and the destination for auto-forwarding dead-letter messages. Cerebrata helps us in updating the topic subscription properties at ease at any time.

The below illustration shows how to edit the properties of a Topic Subscription.

Topic-Subscription-Update

Update Status

In some cases, the application may not receive messages from the Topic Subscription for some reason. In such cases, it is important to stop receiving messages from the Topic Subscription. This can be done by setting the status of the Topic Subscription to ReceiveDisabled.

The below illustration shows how to edit the status of a Topic Subscription.

Topic-Subscription-Update-Status

Delete Topic Subscription

It is also necessary to delete the topic subscription that is of no use in the namespace to prevent the unwanted cost incurred due to the messages in them.

The below illustration shows how to delete a Topic Subscription.

Topic-Subscription-Delete


Was this article helpful?