This commit is contained in:
Julius Unverfehrt 2022-02-15 09:43:45 +01:00
parent b6411de6b2
commit b9258de347

View File

@ -33,14 +33,14 @@ def main():
parameters = init_params()
connection = pika.BlockingConnection(parameters)
channel = connection.channel()
#channel.queue_declare(queue=CONFIG.rabbitmq.queues.output, durable=True)
# channel.queue_declare(queue=CONFIG.rabbitmq.queues.output, durable=True)
while True:
try:
channel.basic_consume(queue=CONFIG.rabbitmq.queues.input, auto_ack=False, on_message_callback=callback)
logging.info(" [*] Waiting for messages. To exit press CTRL+C")
channel.start_consuming()
except pika.exceptions.ConnectionClosedByBroker as err:
logging.info("Caught a channel error: {}, stopping...".format(err))
continue
@ -51,10 +51,8 @@ def main():
logging.info("Connection was closed, retrying...")
continue
if __name__ == "__main__":
logging_level = CONFIG.service.logging_level
logging.basicConfig(level=logging_level)
main()
main()