Closed rcreynolds53 closed 5 years ago
Thanks for reporting this. we're tracking this internally.
This is happening to me too, but I'm deleting the scheduled messages by their Sequence Number. Same negative information on both ServiceBusExplorer and Azure Portal.
we're currently working to fix this. I'll update and close this issue when we have sorted this out.
@axisc the label backlog
is not exactly going along with your comment. Perhaps you meant to apply in-progress
label?
Hi @rcreynolds53 & @calvaradocl , just want to confirm for debugging purpose, was there any activities (scheduling / send / receive messages) while the cancellation was going on?
Also, is the piece of code running as a single instance? I.e., are there multiple instances of this code running in parallel maybe with cancelling faster in mind?
Thank you.
Update: we have checked in the fix for both standard and premium messaging, the fix is expected to be included in the next major deployment.
This is still happening within our subscriptions. Our sagas depend on scheduled messages and our ops team is complaining that they can't rely on this number.
Same here. Still happening on our side.
Description
When cancelling scheduled messages without knowing the sequence number, I used the following code using the ServiceBus Message Receiver Class to peek at all messages and then cancel the scheduled messages async. Instead of stopping at zero, when there were no more messages to cancel, the service bus kept deleting messages from the scheduled queue and ended up with a negative number
CODE
var messages = await messageReceiver.PeekAsync(250);
do
{
Console.WriteLine(messages.Count);
await Task.WhenAll(messages.Select(m =>
{
Console.WriteLine(m.SystemProperties.SequenceNumber);
return queueClient.CancelScheduledMessageAsync(m.SystemProperties.SequenceNumber);
}));
messages = await messageReceiver.PeekAsync(250);
} while (messages.Count > 0);
Here is a picture of the message count:
Actual Behavior
Expected Behavior