Commit e0a0fb60 authored by Daniel STAN's avatar Daniel STAN

paramétrise la QUEUE côté serveur

parent b0f3090c
......@@ -7,3 +7,5 @@ PARAMS = pika.ConnectionParameters(host='rabbitmq.crans.org',
port=5671, credentials=CREDS, ssl=True)
DEVICE = "/dev/ttyAMA0" #Ou USB0 sur oie
QUEUE = 'CransTicket' # ou 'CransTicketDebug' en test
......@@ -12,12 +12,12 @@ import config
def run():
conn = pika.BlockingConnection(config.PARAMS)
ch = conn.channel()
ch.queue_declare(queue='CransTicketDebug')
ch.queue_declare(queue=config.QUEUE)
def callback(ch, method, properties, body):
print (" [x] Received %r" % (body,))
dump.print_liste(json.loads(body))
ch.basic_consume(callback, queue='CransTicketDebug', no_ack=True)
ch.basic_consume(callback, queue=config.QUEUE, no_ack=True)
ch.start_consuming()
conn.close()
# fork en arrière plan + pidfile
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment