-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Library name and version
Azure.Messaging.ServiceBus 7.18.4
Describe the bug
When the prefetch count is set to 0 and autocompletemessage is set to false, the code below works as expected.
The processor will pick up the next message and continue processing.
The message will eventually be unlocked and tried again later.
If we set the prefetch count > 0, this does not happen. The processor gets stuck and does not pick up new messages
var serviceBusClient = new ServiceBusClient("xxx");
var processor = serviceBusClient.CreateProcessor("topic", "subscription", new ServiceBusProcessorOptions()
{
PrefetchCount = 1,
AutoCompleteMessages = false
});
processor.ProcessMessageAsync += async args =>
{
var success = false;
if (success)
{
await args.CompleteMessageAsync(args.Message);
}
else
{
//We want the message to be retried when the lock expires
//So we don't complete or abandon it
Console.WriteLine($"Not completing message {args.Message.MessageId}");
}
};Expected behavior
The processor does not halt
Actual behavior
The processor is stuck and does no longer consume messages
Reproduction Steps
Set the prefetch count to > 0
Environment
.NET SDK:
Version: 8.0.404
Commit: 7b190310f2
Workload version: 8.0.400-manifests.2877bc3a
MSBuild version: 17.11.9+a69bbaaf5
Runtime Environment:
OS Name: Mac OS X
OS Version: 15.0
OS Platform: Darwin
RID: osx-x64