Azure / azure-service-bus

☁️ Azure Service Bus service issue tracking and samples
https://azure.microsoft.com/services/service-bus
MIT License
580 stars 775 forks source link

Feature: purge scheduled messages #698

Open SeanFeldman opened 4 months ago

SeanFeldman commented 4 months ago

Description

There are currently two feature requests

  1. 1

  2. 95

    that, over time, have exposed the need for a third feature, combining the two - the ability to purge scheduled messages.

A real-world scenario is an entity that contains many scheduled messages that get invalidated and need to be purged. As often happens, the same entity might contain active messages that must be retained. A purge by receive-and-delete is not applicable. In the absence of the ability to peek at messages by their status, the workaround is to peek all messages and delete scheduled ones. This can take hours, based on the number of scheduled messages. A solution would be to add a feature to purge scheduled.

EldertGrootenboer commented 4 months ago

Thank you for suggesting this feature. However, since we're not considering it in the short-term, we've added it to our backlog. To help us give this the right priority, it would be helpful to see others vote and support this feature, as well as explain their scenarios. Moreover, we are currently working on the two features mentioned in the request, which might be able to help accomplish this ask already. Once these are implemented, we will discuss internally if this needs to be further addressed.

SeanFeldman commented 4 months ago

Yeah, I realize it won't be available in the short term (1-3 years).

Moreover, we are currently working on the two features mentioned in the request, which might be able to help accomplish this ask already.

It won't. One feature is purging the whole queue - not applicable. Another feature is to peek messages by status - also not applicable because it forces to receive and delete all scheduled messages. Arguably, the 2nd feature is a workaround (instead of peeking all messages, just peek and complete scheduled ones), but if we talk about significant quantities of messages, that's still going to be painful.

Once these are implemented, we will discuss internally if this needs to be further addressed.

That's fair. Thanks.

EldertGrootenboer commented 2 months ago

We have added this feature in our backlog, however we currently don't have an ETA on when development might start on this. For now, to help us give this the right priority, it would be helpful to see others vote and support this feature, as well as explain their scenarios.

SeanFeldman commented 2 months ago

A couple of scenarios I encountered.

  1. SBExplorer allows you to purge a queue by implementing a hack - receiving and deleting all the messages. It would be better to have a native capability rather than do what SBE is doing, especially for users with large message sizes.
  2. Client systems have long-running workflows that schedule messages. Those workflows can be terminated earlier, but there's no way to clean up the scheduled messages associated with the terminated workflow instance. This causes unnecessary invocation when those messages arrive and confusing logging because it triggers false positives.