[rabbitmq-discuss] Turning off prefetch in the asynchronous_consumer_example

Scott Chapman Scott.Chapman at servicenow.com
Thu Mar 7 18:16:10 GMT 2013


Code from here:
https://github.com/pika/pika/blob/master/docs/examples/asynchronous_consumer_example.rst

I've tried putting the qos call here:

    def on_channel_open(self, channel):
        """This method is invoked by pika when the channel has been opened.
        The channel object is passed in so we can make use of it.

        Since the channel is now open, we'll declare the exchange to use.

        :param pika.channel.Channel channel: The channel object

        """
        LOGGER.debug('Channel opened')
        channel.basic_qos(prefetch_count=1)
        self._channel = channel
        self.add_on_channel_close_callback()
        self.setup_exchange(self.EXCHANGE)

It did not turn off prefetching.  Messages still show up in RabbitMQ as Unacknowledged rather than Ready when I send one and send a 2nd before the 1st is done processing.

What am I missing?

I want to turn off prefetching.
I can't figure out how to turn it off on the Connection. That would be preferable, or turn it off globally.

Any clues GREATLY appreciated.

Thanks,
Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130307/0841a31b/attachment.htm>


More information about the rabbitmq-discuss mailing list