Last active
March 1, 2022 20:32
-
-
Save FernandoCelmer/b004afed646a0042719fd487aae27a2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
import pika | |
import environ | |
env = environ.Env() | |
environ.Env.read_env() | |
rabbitmq_url = env("RABBITMQ_URL") | |
params = pika.URLParameters(rabbitmq_url) | |
connection = pika.BlockingConnection(params) | |
channel = connection.channel() | |
channel.queue_declare(queue='intro_rabbitmq') | |
channel.basic_publish(exchange='', routing_key='intro_rabbitmq', body='Ola Mundo!') | |
print(" [x] Enviado 'Ola Mundo!'") | |
connection.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment