- 进入容器内部安装
- 首先容器启动rabbitmq
- 上官网下载对应版本的插件
插件下载地址:https://www.rabbitmq.com/community-plugins.html 找到rabbitmq_delayed_message_exchange下载 https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases/tag/3.8.9
- 将插件复制到容器内,进行安装
拷贝至docker容器内 docker cp rabbitmq_delayed_message_exchange-3.8.9-0199d11c.ez rabbitmq容器ID:/plugins 进入docker容器内 docker exec -it rabbitmq bash 赋予权限 chmod 777 /plugins/rabbitmq_delayed_message_exchange-3.8.9-0199d11c.ez 启动延时插件 rabbitmq-plugins enable rabbitmq_delayed_message_exchange
- 查看Exchanges的type多了一个x-delayed-message
- 使用DockerFile 安装
-
from rabbitmq:management COPY ["rabbitmq_delayed_message_exchange-3.8.9-0199d11c.ez" , "/plugins/"] RUN chmod 777 /plugins/rabbitmq_delayed_message_exchange-3.8.9-0199d11c.ez RUN rabbitmq-plugins enable --offline rabbitmq_delayed_message_exchange
-