pika
This commit is contained in:
parent
1285a770fc
commit
2fdd477bda
@ -13,7 +13,11 @@ from Sprint import settings
|
|||||||
|
|
||||||
def send_to_queue(queue_name, payload):
|
def send_to_queue(queue_name, payload):
|
||||||
with pika.BlockingConnection(
|
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:
|
) as connection:
|
||||||
channel = connection.channel()
|
channel = connection.channel()
|
||||||
channel.queue_declare(queue=queue_name)
|
channel.queue_declare(queue=queue_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user