ReceiveAsync<T> does not respect PrefetchCount
See original GitHub issueWhen running this code the PrefetchCount is not respected and multiple messages on the queue are consumed simultaneously:
await bus.SendReceive.ReceiveAsync<TestDto>("my.queue", async h =>
{
await Task.Delay(2000);
}
, config =>
{
config.WithPrefetchCount(1);
config.WithDurable(true);
config.AsExclusive(false);
config.WithAutoDelete(false);
});
This code consumes the messages one by one (as expected):
await bus.SendReceive.ReceiveAsync("my.queue", x => x
.Add<TestDto>(async h =>
{
await Task.Delay(2000);
})
, config =>
{
config.WithPrefetchCount(1);
config.WithDurable(true);
config.AsExclusive(false);
config.WithAutoDelete(false);
});
Is this the expected behaviour? I would expect the same behaviour from those two implementations.
- EasyNetQ version: [
7.3.5
] - RabbitMQ version: [
3.11.5
]
Issue Analytics
- State:
- Created 9 months ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
c# - ActiveMQ + NMS. Prefetch limit not respected
My understanding of the prefetch is that a synchronous consumer will be sent x messages and then once it has acknowledged 50% of...
Read more >ServiceBusTrigger: prefetchCount not respected when ...
Only prefetches 1 message, rather than 10 (as specified in the host.json file). This does not seem to be the expected behaviour.
Read more >QueueClient.PrefetchCount Property
Remarks. When Prefetch is enabled, the client will quietly acquire more messages, up to the PrefetchCount limit, than what the application immediately asks...
Read more >XPO Async/Await Methods for XPQuery, Session.Evaluate, ...
I've looked through the sources of XPQuery and XPBaseQuery but I don't see how I can build or get the where clause from...
Read more >Async / Await vs. PipeTo in Akka.NET Actors
Assuming I have 100 actors and every actor will jump into await section inside ReceiveAsync and will wait 60seconds, will not that block...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the fix. Closing this.
https://www.nuget.org/packages/EasyNetQ/7.3.6