19 lines
438 B
Python
Executable file
19 lines
438 B
Python
Executable file
#!/usr/bin/env python
|
|
|
|
import pika
|
|
import json
|
|
import dump
|
|
import config
|
|
|
|
params = pika.URLParameters(config.URL)
|
|
conn = pika.BlockingConnection(params)
|
|
ch = conn.channel()
|
|
ch.queue_declare(queue='CransTicket')
|
|
def callback(ch, method, properties, body):
|
|
print " [x] Received %r" % (body,)
|
|
dump.print_liste(json.loads(body))
|
|
|
|
|
|
ch.basic_consume(callback, queue='CransTicket', no_ack=True)
|
|
ch.start_consuming()
|
|
conn.close()
|