Search code examples
javajmxactivemq-artemis

How to create a user in ActiveMQ Artemis?


I don't understand how to create user with password in ActiveMQ Artemis

Here is my artemis-roles.properties:

amq = admin
test = admin

Here is my artemis-users.properties:

admin = ENC(1024:28CE6B0C9D3FA57ECD8956D429030E5414B730FEEA285A7C8DFEBA434296674C:7946CE5918E1AA81D7D40345F1D348E2293DECBD39F15C45A8E7A308F3C54B128B20B499F6A9A0876BFA834C9E28FBA3076ECB69976031CFC9BDE71B5D0F8B13)

I don't understand how to create a user with login - test and password too - test. This user with the role will be used to connect via JMX


Solution

  • One way to create a user with the default properties files is to the use the suite of "user" commands offered by the Artemis CLI, e.g.:

    ./artemis user add --user-command-user admin --user-command-password adminPassword --role test
    

    This is discussed further in the documentation. You can also run the ./artemis help user command to get details on all the different "user" commands and their options.

    Of course, you can also edit the files manually as well. The syntax of the artemis-roles.properties file is:

    <role> = <listOfUsers>
    

    The listOfUsers could be a single user or a comma-separated list of users in that role.

    The syntax of the artemis-users.properties file is:

    <user> = <password>