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()