Answers for "rabbitmq pika username password"

1

rabbitmq pika username password

#!/usr/bin/env python
import pika

credentials = pika.PlainCredentials('the_user', 'the_pass')
parameters = pika.ConnectionParameters('132.45.23.14',
                                   5672,
                                   '/',
                                   credentials)

connection = pika.BlockingConnection(parameters)

channel = connection.channel()

channel.queue_declare(queue='hello', durable=Ture)

channel.basic_publish(exchange='',
                  routing_key='hello',
                  body='Hello W0rld!')
print(" [x] Sent 'Hello World!'")
connection.close()
Posted by: Guest on January-20-2021

Code answers related to "rabbitmq pika username password"

Python Answers by Framework

Browse Popular Code Answers by Language