1. 程式人生 > 其它 >docker 安裝rabbitmq 延時外掛rabbitmq_delayed_message_exchange

docker 安裝rabbitmq 延時外掛rabbitmq_delayed_message_exchange

  • 進入容器內部安裝
    • 首先容器啟動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
stay hungry stay foolish!