diff --git a/config.py.example b/config.py.example index 4de3e8e..5b2b3a2 100644 --- a/config.py.example +++ b/config.py.example @@ -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 diff --git a/daemon.py b/daemon.py index df84579..7ca7860 100755 --- a/daemon.py +++ b/daemon.py @@ -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