A command line tool to manage Azure Service Bus dead letter queue messages.
$ dotnet add package AzureServiceBusDLQdotnet tool install AzureServiceBusDLQ --global
[!NOTE]
Listen claims is required.
Connecting to the azure service bus namespace can be done in two ways:
-c {my connection string}-n {my namespace}
DefaultAzureCredentials will be used to authenticateIn this example using the namespace name:
asb-dlq queues -n my-asb-namespace
Outputs:
Returns:
0 if no queues contains DLQ/TDLQ messages1 if at least one queue have DLQ/TDLQ messagesIn this example using the namespace name:
asb-dlq queue my-queue -n my-asb-namespace
Outputs:
Details of all DLQ and TDLQ messages for the specified queue.
Returns:
0 if no DLQ/TDLQ messages exists
1 if at least one DLQ/TDLQ message exists
Retries DLQ messages by moving them back to the parent queue.
[!NOTE]
Transactions are used to ensure that retries are atomic.
In this example using the namespace name:
asb-dlq retry-queue my-queue -n my-asb-namespace
Outputs:
Message details for retried messages.
Returns:
0 if messages where retried successfully or if no DLQ messages where found.
1 if DLQ messages failed to be retried
Moves DLQ messages to the target queue.
[!NOTE]
Transactions are used to ensure that the move is atomic.
Move single queue with default transformation (see below):
asb-dlq move-dlq-messages my-source-queue my-target-queue -n my-asb-namespace
Using NServiceBus transformation:
asb-dlq move-dlq-messages my-source-queue my-target-queue --transform nservicebus -n my-asb-namespace
Outputs:
Returns:
0 if messages where moved successfully or if no DLQ messages where found.1 if DLQ messages failed to be movedThe move operation will capture metadata about the DLQ message via transformations. The following transformations are available.
Adds the following application properties to the moved message:
x-asb-dlq-source-queue: Queue name where the message was dead letteredx-asb-dlq-reason: Dead letter reasonx-asb-dlq-description: Dead letter descriptionAdds the following application properties to the moved message:
NServiceBus.FailedQ: Queue name where the message was dead letteredNServiceBus.ProcessingMachine: This is required by the Particular Platform to proper show the message, defaulted to unknownNServiceBus.ExceptionInfo.ExceptionType: Dead letter reasonNServiceBus.ExceptionInfo.Message: Dead letter descriptionNServiceBus.MessageId: Unless already present the native Azure ServiceBus message id will be used as the message id[!NOTE]
Microsoft recommends to, where possible, include the exception type in the DLQ reason and stacktrace in the DLQ description.
No modifications are done to the moved message.