distributed-computing/tasks/yudenicheva-ds/lab_4/python4Lab/Tut1/send.py

11 lines
306 B
Python
Raw Permalink Normal View History

2023-12-20 20:57:51 +04:00
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='Logs')
channel.basic_publish(exchange='',routing_key='yudenicheva',body='Hello')
print(" [x] Отправлено сообщение")
connection.close()