pardahlman / RawRabbit

A modern .NET framework for communication over RabbitMq
MIT License
747 stars 144 forks source link

WithPrefetchCount is not honored ? #207

Closed cemremengu closed 7 years ago

cemremengu commented 7 years ago

I specify the configuration:

                ctx => ctx.UseConsumerConfiguration(
                    cfg => cfg.Consume(c => c
                            .FromQueue("gsmcellkpireceived")
                            .WithPrefetchCount(350)
                            .WithRoutingKey("gsm.cell.kpi"))
                        .OnDeclaredExchange(e => e
                            .WithName("abid.kpi")
                            .WithType(ExchangeType.Topic))));

But the prefetch looks zero ?

queue

pardahlman commented 7 years ago

Thanks for reporting this! I'll look into this, if unless you want to dig into the code?

cemremengu commented 7 years ago

Searching a bit, I think

https://github.com/pardahlman/RawRabbit/blob/3bc63b1972537092bf2d5378b69c904ba22af86d/src/RawRabbit/Consumer/Eventing/EventingBasicConsumerFactory.cs#L63

may be the problem after seeing this discussion

looks like prefetch size must be null ? Any ideas ?

pardahlman commented 7 years ago

Hello @cemremengu - I looked into this a bit further, and it turns out that the code you are referring got lost somewhere on the way to 2.0. It was such a small fix once I found the reason, so I did it myself. Hope you haven't invested to much time at your end!

cemremengu commented 7 years ago

I tried to locate the code setting the prefetchCount for sometime but couldn't find and gave up. So that explains everything :smile:

Thanks for the quick fix!

pardahlman commented 7 years ago

No worries, mate!