In the RabbitMQ .NET client, QueueingBasicConsumer
is deprecated.
They recommend to use EventingBasicConsumer
instead. I implemented the IQueueingBasicConsumer
interface for the same way they did and it works well.
However, I am curious to why it is deprecated and why I should use EventingBasicConsumer
?
I think (I might be wrong!) it's done because of performance reasons. QueueingBasicConsumer
uses SharedQueue<T>
which is basically .NET Queue
with locks. In order to handle a delivery, you need to lock on queue, enqueue an item and notify other threads waiting for the queue (Monitor.Pulse).
EventingBasicConsumer
doesn't use any queueing mechanism. It simply fires Received (HandleBasicDeliver) event which you need to handle in your code.
As you can see now EventingBasicConsumer
has less performance overhead, so it's faster (it should be).
Read this discussion. Michael Klishin is the maintainer of .NET RabbitMQ client on GitHub.
But if you don't feel like going to different links and reading there I'll summarize...
QueingBasicConsumer does not autorecover in current version, and it was a work around for a message dispatcher issue which no longer exists. But also I think Alexey is right, the performance was probably an issue too with the locking and busy waiting (in most implementations) the queue was introducing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With