Service Bus Topic Subscription
  • 12 Feb 2024
  • 6 Minutes to read
  • Dark
    Light
  • PDF

Service Bus Topic Subscription

  • Dark
    Light
  • PDF

Article Summary

Introduction

Azure Service Bus is a messaging service on the cloud that is used to connect any application, device, or service running in the cloud to any other application or service.

As a result, it acts as a messaging backbone for applications available in the cloud or across any device. A queue allows the processing of a message by a single consumer.

In contrast to queues, topics and subscriptions provide a one-to-many form of communication in a publish and subscribe pattern.

It is useful for scaling to large numbers of recipients.

Users can associate a Service Bus Topic Subscription to Turbo360 Business Application to accomplish the following operations.

View messages

  • The real challenge in dealing with Service Bus Queues/Topics in the Azure portal is, there is no visibility on the messages. In real-time, there is an immense need to access and process the Service Bus messages to keep the business going.

  • Turbo360 solves this problem by allowing users to query the messages in Active-end or Dead-Letter queues, in a specific state such as the Peek or Deferred state, and by providing the message count and Sequence number to start retrieving from.

  • Not only these, but users can also perform queries on the retrieved messages to filter them based on their System and/or Custom properties, Dead-letter reason (For Dead-letters) which includes system provided reasons as well as custom error reasons.

The below illustration shows retrieving messages in a Peek mode.

peekmsg.gif

The below illustration shows retrieving messages in a Defer mode. This mode defers the number of messages provided in the Message Count, which can be accessed from the Deferred Active Messages and Deferred Dead-Letter tabs anytime.

defermsg.gif

Peek modeDefer mode
Messages will be peeked. This will not affect the active receivers in the active-end Queue.Messages will be deferred. This will affect the active receivers of the active-end Queue.
The Delivery count of the message will not be increasedDelivery count of the message will be increased
Cannot perform delete operationCan perform delete operation
  • Perform out-of-the-box querying on the retrieved messages based on the system or custom properties.

filtermsg.gif

  • Filter messages by Enqueued time using AND/OR operators.

image.png

Points to remember:
  • To access a deferred message, it is required to know the message sequence number. With Turbo360, get access to all the messages in the deferred state without the need to know their sequence number.

  • Messages larger than 100 MB can be retrieved in batches of 50 for optimal performance.

Save a query filter

  • The queries used for filtering can be saved with the help of Save button available next to Filter option. You can access all saved queries by clicking the Saved queries option at the top of the screen.

  • The default query can be defined so that it will be displayed for user convenience when retrieving messages from Service Bus Topic Subscription in any mode. Clicking on the Filter option will filter data based on the default query available.

image.png

Update status

  • Users can update the status of the Service Bus Topic Subscription resource by clicking on the Update status option and selecting one among the list of available options.

image.png

  • Users can also update the status of multiple Service Bus Topic Subscription resources by performing a bulk operation in the Service Bus Topic Subscription resource section.

image.png

Rules management

Users can add filters to the Topic Subscriptions, based on which the messages from the Topic will get into the Subscription.

Two types of filters can be added:

  • SQL Filter - maintains a conditional expression similar to SQL that is checked in the broker against the user-defined properties and system properties of the incoming messages.

  • Correlation Filter - keeps a list of conditions that are checked against one or more of the user and system properties of an incoming message.

Consider the following scenario: a user wants to receive messages with "BookingId" ranging from 1 to 100 and wants to set the property "customer" to "known".

Message

 {
 BookingId=1;
 Customer="Unknown";
 }

The following sql filter and action can be provided:
Filter
BookingId >= 1 and BookingId <=100

Action
SET Customer = 'Known'

image.png

Process messages

Messages can be processed in a lot of ways as Turbo360 provides all capabilities that are lagging in many enterprise Service Bus management applications.

Below are the top capabilities for dealing with a Service Bus Queue:

  • Resubmit
  • Repair & Resubmit
  • Save
  • Delete
  • Backup
  • View Message details
  • View Message properties
  • View Dead-letter reason and description
  • Perform Automated tasks

The options under Actions button (Save, Resubmit, Repair & Resubmit) will be disabled when selecting messages larger than 1mb.

Messages larger than 10 MB will not be able to access the context menu options, excluding resubmit and properties.

Resubmit messages

  • There is a need for every application that uses Service Bus to resubmit a message that has gone into the dead-letter queue back to the same topic.

  • Turbo360 provides options to resubmit a single message or bulk of messages from the active-end or dead-letter back to the same topic, different topic, queue, or an API Endpoint.

The below illustration shows how easily users can resubmit messages.

image.png

Avoid duplicate message loss
  • Sending messages with the same message id to a Service Bus resource with duplicate detection enabled will result in the duplicate messages being ignored.

  • Turbo360 allows users to regenerate message id manually or automatically while resubmitting messages.

Repair and Resubmit messages

Not only resubmitting but also repairing and resubmitting a message is always a requirement for applications using Service Bus in several use cases. Turbo360 provides multiple options that users can use to repair and resubmit Service bus messages.

  • Inline Repair and Resubmit single message
  • Bulk Repair and Resubmit messages using Excel sheet

The below illustration shows repairing and resubmitting a single message directly from Turbo360.

image.png

Save messages

  • Users can not only view but also download messages from a Topic Subscription as a compressed (zipped) folder.

Backup and Delete messages

  • Deleting messages that are in a dead-letter queue for a long time, or messages that are not required anymore is a real-time business need.

  • Using Turbo360, messages from both active-end and dead-letter can be deleted simply by choosing the Delete option.

  • To avoid deleting a message by mistake, or to clear up the Topic subscription but backup the messages in some other place, users can use the backup option to backup messages safely in an associated Storage Blob container before processing them.

image.png

Inline task

  • In the Service Bus Topic Subscription section, users can create a really quick task to purge messages from the source subscription that is being explored.

  • The configuration created to run immediately can also be saved for future use in the Automated Tasks section.

Inline task to purge messages

This feature allows users to quickly purge messages from the topic subscription by providing the following inputs:

  • Message count (can be all or a specified number)
  • Queue type (Active-end queue or Dead-Letter queue)
  • Message Enqueued At time
  • Configuration name (if Save configuration is enabled)

The following illustration shows purging 10 messages from a Dead-Letter enqueued at or before the specified date and time.

Task status can be viewed by navigating to Automated Tasks section and switching to Task history tab.

Users can use this feature to quickly create a task that runs immediately.

Navigate to the Automated Tasks section in Turbo360 to create a task with a more detailed configuration, schedule tasks to run at a specific time, or automate the task to run on the specified hours, days, and more.

Automated task

  • Large applications that heavily rely on Service Bus cannot manually process messages all the time.

Service Bus Topic can process hundreds and thousands of active and dead-lettered messages without the need for human intervention using automated tasks.

  • The Automated Task feature of Turbo360 makes it possible to accomplish all these requirements.

Monitoring

  1. Navigate to Service Bus Topic Subscription -> Monitoring to configure the monitoring rules for Topic Subscriptions
  2. Select the necessary monitoring metrics and configure the threshold values
  3. Click Save

The threshold values can also be provided with any metric name, defining the monitoring rule to be violated when the metric value configured at threshold field is met.

image.png

Monitoring rules will be saved for Service Bus Topic Subscription, and the monitoring state for the metrics will be reflected after every monitoring cycle.


Was this article helpful?

What's Next