Rabbitmq: Enable jms plugin externally

Created on 3 Apr 2017  路  4Comments  路  Source: docker-library/rabbitmq

Hi,

We're trying to use the management-alpine image and enable the JMS plugin along with it.

# docker run -d --hostname rabbit-dev --name rabbit -p 8081:15672 rabbitmq:management-alpine
# docker run rabbitmq:management-alpine rabbitmq-plugins enable rabbitmq_jms_topic_exchange 

However, the configuration fails with:

Applying plugin configuration to rabbit@34862d2806fd... failed.
 * Could not contact node rabbit@34862d2806fd.
   Changes will take effect at broker restart.
 * Options: --online  - fail if broker cannot be contacted.
            --offline - do not try to contact broker.

Adding --offline does "load" plugin, but doesn't enable it.

BUT if you go into the container itself

docker exec -i -t rabbit /bin/bash
rabbitmq-plugins enable rabbitmq_jms_topic_exchange

That does actually load and enable the plugin.

What's the proper way of doing this so that we don't have to manually enable the plugin?
Thanks.

Most helpful comment

You can also edit (generate) the file that contains the list of enabled plugins, in this case /etc/rabbitmq/enabled_plugins. It's an Erlang list of atoms followed by a dot. There is nothing wrong with modifying that file during deployment before the node is started.

All 4 comments

OS: CentOS 7.4
Docker: 17.03
Container version: 3.6.9

You are trying to enable plugins in a container where the service is not enabled.
If you first turn on the container, and then turn on plugins - everything works.

# docker run -d --name test_rabbitmq rabbitmq:3-management-alpine 26fb3451338e4e14d59d4bc4d8f6505160740f540b966444c944ac0504603515
# docker exec -it test_rabbitmq rabbitmq-plugins enable rabbitmq_jms_topic_exchange The following plugins have been enabled: rabbitmq_jms_topic_exchange Applying plugin configuration to rabbit@26fb3451338e... started 1 plugin.
# docker exec -it test_rabbitmq cat /etc/rabbitmq/enabled_plugins [rabbitmq_jms_topic_exchange,rabbitmq_management].

Thank you very much, that worked.

You can also edit (generate) the file that contains the list of enabled plugins, in this case /etc/rabbitmq/enabled_plugins. It's an Erlang list of atoms followed by a dot. There is nothing wrong with modifying that file during deployment before the node is started.

Was this page helpful?
0 / 5 - 0 ratings