RabbitMQ Delayed Message Plugin With Docker

RabbitMQ Delayed Message Plugin With Docker

1.官网下载插件 Delayed Message Plugin

http://www.rabbitmq.com/community-plugins.html

2.启动docker

>docker run -d -p 5672:5672 -p 15672:15672 -it rabbitmq:management

3.查看docker 进程

>docker ps
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS                                                                                        NAMES
2305078e048d        rabbitmq:management   "docker-entrypoint.s…"   39 minutes ago      Up 39 minutes       4369/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp, 15671/tcp, 25672/tcp, 0.0.0.0:15672->15672/tcp   mystifying_khorana

4.进入docker bash

>docker exec -i -t 2305078e048d bash //进入bash
root@2305078e048d:/# ls
bin   docker-entrypoint.sh  lib    mnt      proc  sbin  tmp
boot  etc                   lib64  opt      root  srv   usr
dev   home                  media  plugins  run   sys   var

5.拷贝插件到docker里

>docker cp .\rabbitmq_delayed_message_exchange-20171201-3.7.x.ez 2305078e048d:/plugins

6.启动插件

>rabbitmq-plugins enable rabbitmq_delayed_message_exchange

验证:打开管理页面查看exchange类型是否多了一项x-delayed-message ,如是则说明安装成功

RabbitMQ Delayed Message Plugin With Docker_第1张图片
rabbitmq_delayed_message_exchange

代码验证

RabbitMQ Delayed Message Plugin With Docker_第2张图片
生产者
消费者
RabbitMQ Delayed Message Plugin With Docker_第3张图片
delayed-msg.gif

你可能感兴趣的:(RabbitMQ Delayed Message Plugin With Docker)