-
-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
Dear Author,
I am currently utilizing the BatchReceiveAsync method in my project, and I've encountered an issue where the number of messages received exceeds the limit set by BatchReceivePolicy.maxNumMessages. Despite configuring the BatchReceivePolicy to limit the number of messages per batch, the method occasionally returns more messages than specified.
await using var consumer =
await pulsarClient.NewConsumer(Schema.STRING(Encoding.UTF8))
.Topic(_topic)
.SubscriptionName(_subscription)
.SubscriptionType(SubscriptionType.Shared)
.SubscriptionInitialPosition(SubscriptionInitialPosition.Latest)
.AutoUpdatePartitions(true)
.NegativeAckRedeliveryDelay(TimeSpan.FromMilliseconds(500))
.BatchReceivePolicy(new BatchReceivePolicy(100, -1L, TimeSpan.FromSeconds(10)))
.SubscribeAsync();
var messages = await consumer.BatchReceiveAsync(CancellationToken);
var len = messages.Count; // len = ReceiverQueueSize(default: 1000)
Metadata
Metadata
Assignees
Labels
No labels