Clear pending messages on an Azure Service Bus without a sequence number

Is there a way to recover or delete a pending message on Azure Service Bus if I lose my sequence number?

Scenario: I want to use BrokeredMessage.Defer()to postpone a message. I plan to write down the serial number and use it later to receive the message. But if something goes wrong - let's say some kind of buggy code is deployed - and the serial number is not written down properly, it looks like this message will sit on the service bus in a pending state until the message expires, which may be forever .

This concerns me primarily because this message will take up a place in the queue or subscription, and I did not find a way to restore this space without waiting for the complete removal of the queue / subscription.

Is there a way to get or delete the "lost" pending messages?

+4
source share
2 answers

Signing messages from a queue or subscription also returns pending messages. Pending messages will have the status = "Pending".

In this way, you can retrieve the sequence numbers of pending messages, and then process or delete these messages.

You can try this in the ServiceBus Explorer:

Postponed message in ServiceBus Explorer

+1
source

- , , , , . , , ().

" " ​​ . , , . - (BrokeredMessage.TimeToLive), .

, Queue.Receive:

http://markheath.net/post/defer-processing-azure-service-bus-message

( :-)), (JSON, ..) , ( , ).

+2

Source: https://habr.com/ru/post/1658859/


All Articles