From 2fdd477bdadc86cd47b6446246d668677376a28a Mon Sep 17 00:00:00 2001 From: Administrator Date: Tue, 16 Aug 2022 13:43:20 +0300 Subject: [PATCH] pika --- SprintLib/queue.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SprintLib/queue.py b/SprintLib/queue.py index 5154560..df6576c 100644 --- a/SprintLib/queue.py +++ b/SprintLib/queue.py @@ -13,7 +13,11 @@ from Sprint import settings def send_to_queue(queue_name, payload): with pika.BlockingConnection( - pika.ConnectionParameters(host=settings.RABBIT_HOST, port=settings.RABBIT_PORT) + pika.ConnectionParameters( + host=settings.RABBIT_HOST, + port=settings.RABBIT_PORT, + credentials=pika.PlainCredentials('guest', settings.RABBIT_PASSWORD) + ) ) as connection: channel = connection.channel() channel.queue_declare(queue=queue_name)