Search code examples
azureservicebus

Is there a way to delete a pending message from a Service Bus Queue in Azure?


I am currently queuing messages to be run at a future date with .scheduledEnqueueTime. Sometimes the events that the messages are relaying data about change or are deleted, and when this happens I need to delete the message. I don't see how to find it or interact with it when I search, can someone point me in the right direction?


Solution

  • You are right Natahan that currently there is no way to cancel (delete) a scheduled message from a Service Bus Queue. We have had other customers run into this scenario and will add this feature in a future milestone. In the meantime I have seen folks use patterns of tracking progress of a certain workitem in Session state and when the scheduled message show up they check to see the Session state and if it is already complete/resolved then just ignore the message (and maybe then null out the session state).