[rabbitmq-discuss] Pika AttributeError: Channel instance has no attribute 'start_consuming'

KooT rafalkot at gmail.com
Tue May 31 19:10:05 BST 2011


Yes, its worker.py from http://www.rabbitmq.com/tutorials/tutorial-two-python.html

#!/usr/bin/env python
import pika
import time

connection = pika.BlockingConnection(pika.ConnectionParameters(
        host='localhost'))
channel = connection.channel()

channel.queue_declare(queue='task_queue', durable=True)
print ' [*] Waiting for messages. To exit press CTRL+C'

def callback(ch, method, properties, body):
    print " [x] Received %r" % (body,)
    time.sleep( body.count('.') )
    print " [x] Done"
    ch.basic_ack(delivery_tag = method.delivery_tag)

channel.basic_qos(prefetch_count=1)
channel.basic_consume(callback,
                      queue='task_queue')

channel.start_consuming()


On 31 Maj, 16:02, "Gavin M. Roy" <g... at myyearbook.com> wrote:
> Are you using the BlockingConnection adapter?
>
>
>
>
>
>
>
> On Tuesday, May 31, 2011 at 9:30 AM, KooT wrote:
> > python worker.py
> >  [*] Waiting for messages. To exit press CTRL+C
> > Traceback (most recent call last):
> >  File "worker.py", line 22, in ?
> >  channel.start_consuming()
> > AttributeError: Channel instance has no attribute 'start_consuming'
>
> > I got pika 0.9.5
> > _______________________________________________
> > rabbitmq-discuss mailing list
> > rabbitmq-disc... at lists.rabbitmq.com (mailto:rabbitmq-disc... at lists.rabbitmq.com)
> >https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


More information about the rabbitmq-discuss mailing list