创建镜像
docker run -d --hostname my-rabbit --name rabbit -p 5672:5672 -p 15672:15672 -e RABBITMQ_DEFAULT_USER=user -e RABBITMQ_DEFAULT_PASS=password rabbitmq:3-management
下载延时队列插件
wget https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases/download/v3.8.0/rabbitmq_delayed_message_exchange-3.8.0.ez
启用延时队列插件
# 复制到容器中
docker cp rabbitmq_delayed_message_exchange-3.8.0.ez rabbit:/plugins
# 进入容器
docker exec -it rabbit bash
#容器中进入插件目录
cd /plugins
#启用插件
rabbitmq-plugins enable rabbitmq_delayed_message_exchange