安装

[root@CenOSDVD ~]# docker pull rabbitmq:3-management
Trying to pull repository docker.io/library/rabbitmq ... 
3-management: Pulling from docker.io/library/rabbitmq
35c102085707: Already exists 
251f5509d51d: Already exists 
8e829fe70a46: Already exists 
6001e1789921: Already exists 
79bdb7145cce: Pull complete 
a53ba598956f: Pull complete 
78be6aa88825: Pull complete 
78743b5c9607: Pull complete 
af023e02a847: Pull complete 
2259c0afa940: Pull complete 
347b67546dd0: Pull complete 
a139db4173f7: Pull complete 
Digest: sha256:5c845fdd42a650aa236d28d52e4f8f802fa06bb87e4c44589cb7f38bb580abb7
Status: Downloaded newer image for docker.io/rabbitmq:3-management
[root@CenOSDVD ~]# docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE
docker.io/rabbitmq   3-management        7601e834fa14        3 weeks ago         177 MB
docker.io/redis      latest              f7302e4ab3a8        3 weeks ago         98.2 MB
[root@CenOSDVD ~]# docker run -d -p 5672:5672 -p 15672:15672 --name myrabbitmq 7601e834fa14
7cf538299cad4b293c1b5d6ddfb4844d70711b1ec927c46bd94dedd56fe23f03

在浏览器输入ip号:15672,进入rabbitmq的管理界面,密码账号默认为guest。

停止和启动

docker stop container-name/container-id
docker start container-name/container-id

rabbitmq的使用

点击Exchanges->点击Add a new exchange添加交换器

点击Queues点击->Add a new queues添加队列

进行交换器与队列的绑定

发送消息

得到信息