DEV Community

Cover image for Resubmit and Delete Dead-letter Messages of Queues and Topic Subscriptions
Nadeem ahamed
Nadeem ahamed

Posted on • Updated on • Originally published at serverless360.com

Resubmit and Delete Dead-letter Messages of Queues and Topic Subscriptions

Azure Service Bus is used as a messaging service in many enterprises. Service Bus contains two types of messaging entities, Queues, and Topics.

Queue

Queues transmit the messages in FIFO (First In, First Out) message delivery. Each message in a Queue can be received by only one active receiver.

Topic

In contrast to the Queues, Topics may contain multiple Subscriptions, each Subscription resembles a Queue. So, the same message can be received from different Subscriptions of a Topic. Based on predefined Rules, the messages can be sent to different Subscriptions.

Dead-letter

Service Bus Queues and Topic Subscriptions provides a secondary Sub-Queue, called a Dead-letter Queue (DLQ). This Dead-letter Sub-Queue is created at the time of entity creation. Dead-letter Queue holds the messages, which have any problem in processing. The messages in Dead-letter Queue can be removed by receiving it. There are certain reasons, why the messages move to Dead-letter Queue. They are,

  1. HeaderSizeExceeded
  2. TTLExpiredException
  3. Session id is null
  4. MaxTransferHopCountExceeded
  5. Specified by application

For more detailed information on Dead-letter, refer Overview of Service Bus Dead-letter Queues.

Serverless360 provides efficient capabilities to analyze volume of DLQ messages and provide a summary count of messages dead lettered due to various reasons, refer Dead Letter Analytics using Serverless360 for more details

Resubmit and Delete

Service Bus Explorer is the commonly known tool for managing Service Bus entities. Even though it is very useful, it has limitations in handling the Dead-letter messages. In this blog, Let us see how Serverless360 helps to handle dead letter messages in resubmission and delete scenario. To know more on how we built this capability, please read: Serverless360 provides a reliable and safe solution for handling the Dead-letter messages

Peeking Messages from Dead-letter Queue

After configuring Service Bus entities in Serverless360, the Operations section of Service Bus Queue or Topic Subscription provides the options to Resubmit or Delete the Dead-letter messages. The user can navigate to Operations section by clicking the entity path or Operations link.

The Operations section contains three different tabs for handling the main Queue messages and Dead-letter Queue messages.

Messages

Messages from the active Queue can peek under the “Messages” tab. The User can only peek the messages from the active Queue. They cannot receive it. The messages can be retrieved by either specifying the “count” or specifying from “sequence number” along with “count”.

Dead-letter

The dead-letter tab provides the options to access the messages in Dead-letter Queue. The user can choose between two types of receive modes, Peek-Lock or Defer.

Resubmit and delete Azure Service bus dead-letter messages of Queues and Topic with Serverless360.

Peek-Lock

After retrieving the messages, User can filter the messages based on the Error Reason due to which the messages are moved to the Dead-letter Queue. The message body, properties and the reason for Dead-letter can be viewed using the context menu available for each message.

Defer

As discussed in Resubmit and Delete Messages in Azure Service Bus Messaging, receiving messages in Defer mode, changes the message status from Active to Defer. Therefore, the message cannot be removed from the Queue, without the sequence number of the message. Serverless360 allows the Users to Resubmit or Delete the messages received in Defer mode.

Resubmit

Choosing the messages that need to be resubmitted and clicking RESUBMIT link provides the option to choose the destination entity. The destination entity may be a Queue or a Topic under the same namespace.

After choosing the destination entity, by clicking the PROCEED link, the messages get resubmitted to the selected entity and removed from the Dead-letter Queue. The status of the resubmission will be displayed with the required information.

Delete

Similarly, simply selecting the messages and clicking DELETE link deletes the selected messages.

Audit

Serverless360 provides the Governance and Audit logs for the Users. This feature can be used for the tracking of operations. Any user activity to resubmit or delete messages are tracked in this section.

Thus, we have a safe solution to handle the Dead-letter messages of Queues and Topic Subscriptions. In addition to this, Serverless360 provides a more advanced way of Resubmission and Deletion of messages by creating activities.

Top comments (0)