QueueingBasicConsumer Deprecated - why?

2,765 views
Skip to first unread message

William Davis

unread,
Aug 12, 2016, 8:23:32 AM8/12/16
to rabbitmq-users
Using C#

Just noticed that QBC is deprecated. The only mention of this I found on the group is here: 

It mentions that AutoRecovery doesnt support a QBC and that is why it is deprecated. Can someone please go into a little more detail about why we'd drop support for the QBC?

It looks like I'm going to have to spin my own version of this and I'd like some more technical detail around the challenges facing the current implementation.

I was thinking about making my own by extending the EBC and using a BlockingCollection<T> b/c I haven't been able to find much in the way of documentation on writing my own consumer. Anyone with substantial experience that could maybe provide some insight on 'gotchas' etc.? 

Thanks,

Will.


Michael Klishin

unread,
Aug 12, 2016, 8:46:57 AM8/12/16
to rabbitm...@googlegroups.com
It cannot be automatically recovered and due to how consumer dispatch is implemented in
recent versions (using a work pool), it no longer has any reasons to exist.

Originally it was created to allow for synchronous protocol operations (e.g. queue.declare) to be used
from consumer handlers such as handleDelivery. It now works perfectly fine with any consumer.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Michael Klishin

unread,
Aug 12, 2016, 8:48:00 AM8/12/16
to rabbitm...@googlegroups.com
What makes you believe that the way QBC is such a great idea in general? It is a workaround
for a channel consumer dispatch issue that's no longer there.

Simply subclass DefaultBasicConsumer or use EventingBasicConsumer.

On Fri, Aug 12, 2016 at 3:23 PM, William Davis <william....@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William Davis

unread,
Aug 12, 2016, 9:36:19 AM8/12/16
to rabbitmq-users
Why would I want to use a local queue to represent a remote message queue? 

Its semantic, the majority of my architecture is queue based today and introducing eventing didnt fit the mold when we implemented rabbit.

I have several worker threads that pop from a shared queue, specifically a BlockingCollection<T>, do some work and repeat. 

Using the QBC was a natural fit to this.

Its not really a big deal, I'll just roll my own impl of it, but it was certainly convenient that it already existed.



On Friday, August 12, 2016 at 8:48:00 AM UTC-4, Michael Klishin wrote:
What makes you believe that the way QBC is such a great idea in general? It is a workaround
for a channel consumer dispatch issue that's no longer there.

Simply subclass DefaultBasicConsumer or use EventingBasicConsumer.
On Fri, Aug 12, 2016 at 3:23 PM, William Davis <william....@gmail.com> wrote:
Using C#

Just noticed that QBC is deprecated. The only mention of this I found on the group is here: 

It mentions that AutoRecovery doesnt support a QBC and that is why it is deprecated. Can someone please go into a little more detail about why we'd drop support for the QBC?

It looks like I'm going to have to spin my own version of this and I'd like some more technical detail around the challenges facing the current implementation.

I was thinking about making my own by extending the EBC and using a BlockingCollection<T> b/c I haven't been able to find much in the way of documentation on writing my own consumer. Anyone with substantial experience that could maybe provide some insight on 'gotchas' etc.? 

Thanks,

Will.


--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Aug 12, 2016, 9:41:48 AM8/12/16
to rabbitm...@googlegroups.com
Fair enough.

You can make a DefaultBasicConsumer subclass enqueue deliveries onto 
a collection in #handleDelivery and process deliveries from there. Keep in mind that this is still tricky
to recover: your collection reference has to stay "relevant" between recoveries. But since this is your app's code,
it's possible, whereas the library itself cannot make too many assumptions about how QBC is used (e.g. in a while loop
or in any other manner).

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

William Davis

unread,
Aug 14, 2016, 10:48:18 AM8/14/16
to rabbitmq-users
I went ahead and rolled a couple of basic implementations, wanted to share with everyone:

Michael Klishin

unread,
Aug 14, 2016, 11:04:22 AM8/14/16
to rabbitm...@googlegroups.com
Thank you, William, appreciated!

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Marty Wasznicky

unread,
Jan 8, 2018, 9:46:45 PM1/8/18
to rabbitmq-users
I just tried this with the 5.0  Rabbit MQ.NET client.  Seems like BasicQueueConsumer using a Queue no longer works.  DeQueue never returns a message.  Can you please confirm whether or not this still works in the latest Rabbit MQ release?

Michael Klishin

unread,
Jan 9, 2018, 10:00:08 AM1/9/18
to rabbitm...@googlegroups.com
There are no reasons to use QueueingBasicConsumer in modern versions of the client and it will be removed entirely in a future version.
Subclass DefaultBasicConsumer or use EventingBasicConsumer instead.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages