创建挂载目录
mkdir -p /opt/docker/rabbitmq
启动
docker run -d --restart=always --name=rabbitmq -p5672:5672 -p15672:15672 \
-v /opt/docker/rabbitmq:/var/lib/rabbitmq \
rabbitmq:3.9.11-management
安装延时交换机插件
下载地址:https://www.rabbitmq.com/community-plugins.html
找到 rabbitmq_delayed_message_exchange
选择 rabbitmq_delayed_message_exchange-3.9.0.ez
复制到容器内
docker cp rabbitmq_delayed_message_exchange-3.9.0.ez rabbitmq:/plugins
进入容器内 docker exec -it rabbitmq /bin/bash
查看插件
cd plugins
ls |grep delay
插件生效
rabbitmq-plugins enable rabbitmq_delayed_message_exchange