Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- q_connection = pika.BlockingConnection(
- pika.ConnectionParameters(
- host='127.0.0.1',
- virtual_host='/',
- credentials=pika.PlainCredentials(
- username='user',
- password='password'
- )
- )
- )
- channel = q_connection.channel()
- channel.queue_declare(
- queue='processing',
- passive=False,
- durable=True,
- exclusive=False,
- auto_delete=False
- )
- channel.exchange_declare(exchange='router', type='direct', passive=False, durable=True, auto_delete=False)
- channel.queue_bind('processing', 'router')
- def callback(ch, method, properties, body):
- # действия над полученными сообщениями
- ...
- ch.basic_ack(delivery_tag=method.delivery_tag) # а вот тут периодически вылетает ошибка
- channel.basic_consume(
- callback,
- queue='processing'
- )
- channel.start_consuming()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement