Skip to content

tonkon/RabbitMQonDockerDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a demo to use RabbitMQ container. The Receive and Send are written by .Net Core. The host of docker is Ubuntu

1.Create a RabbitMQ container


cd RabbitMQ
chmod +x CreateRabbitMQ.sh
CreateRabbitMQ.sh

Or create it directly from docker run


docker run -d --hostname demo-rabbit --name demo-rabbit -p 5672:5672 -p 15672:15672 rabbitmq:3.7.4-management  

2.Get IP Address of the RabbitMQ container


docker inspect demo-rabbit

3.Add rabbitMQ IPAddress to Env (suppose the IP is 172.17.0.2)


vim ~/.bashrc

Append RABBITMQ_HOST='172.17.0.2' to .bashrc file and then make it effective


source ~/.bashrc

3.Open a shell to build and run receive container(Replace the IPAddress of RabbitMQ)


cd Receive
chmod +x build.sh
build.sh
docker run -it --rm -e RABBITMQ_HOST='172.17.0.2' demo/receive 

4.Open another shell to build and run send container(Replace the IPAddress of RabbitMQ)


cd Send
chmod +x build.sh
build.sh
docker run -it --rm -e RABBITMQ_HOST='172.17.0.2' demo/send 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published