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

Cancelling scheduled messages #659

Closed SeanFeldman closed 1 year ago

SeanFeldman commented 1 year ago

This is somewhat related to the https://github.com/Azure/azure-service-bus/issues/453 issue but not the same.

When a message is scheduled, the API return the sequence number associated with the scheduled message. But the sequence number cannot be used to revoke the message (receive or cancel)

We don't want to break queue principles so we won't implement this on the main entities, but it is something we can consider for the DLQ.

This is quite counterintuitive since what's that sequence number for if not cancelling the scheduled message?

The inability to schedule a message and use the returned sequence number to cancel the scheduled message is misleading and wrong. Simply put, the analogy would be scheduling an appointment, getting a reference number, and being unable to call back and cancel the appointment referring to the original reference number. That breaks the semantics of general scheduling.

To sum it up, if ASB supports scheduling messages and returns sequence numbers, it should also support a feature to revoke scheduled messages by sequence number.

SeanFeldman commented 1 year ago

I need to take sleep time seriously - reason 🤦‍♂️

@EldertGrootenboer would be good to update ScheduleMessageAsync remark to point to the CancelScheduledMessageAsync documentation so that astronauts like me won't raise unnecessary issues.