version: '2'
services:
rabbitmq:
image: rabbitmq:3.6.6-management
hostname: my-rabbit
ports:
- "4369:4369"
- "5671:5671"
- "5672:5672"
- "15672:15672"
app:
image: my_app_image
ports:
- "8000:8000"
docker-compose up
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='my-rabbit'))
channel = connection.channel()
channel.queue_declare(queue='hello')
channel.basic_publish(exchange='',
routing_key='hello',
body='Hello World!')
print(" [x] Sent 'Hello World!'")
connection.close()
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='rabbitmq'))
Best wishes
Noam