Artemis container
Docker container for Apache Artemis - Page 4
How to dynamic configuration works

At each startup, the Artemis container executes the entrypoint.sh script. This script uses the contents of container image embedded environment variables and the supplied configuration file template to build the Apache Artemis broker.xml master configuration file. This construction is done by the substitution of the tags contained in the template by the content of some environment variables. Other environment variables are used to specify configuration files and authentication certificates.

The swarm-deploy.yml deployment descriptor file is used to define the contents of these environment variables, the configuration and certificate files. This allows to reset these contents and parameters each time the container is restarted allowing configuration update.

 
The main configuration file template

The tags in the broker.xml.tmpl template file are used to setting the master configuration file broker.xml as following:

Tag Content Replacement Origin type Replacement origin
{ARTEMISHOST} Container host FQN hostname -f command Dynamic entrypoint.sh command script
{KSFILE} Server certificate keystore full qualified file name KEYSTORE_FILE Environement variable Supplied certificate file
{TSFILE} Server trusted certificates keystore full qualified file name TRUSTSTORE_FILE Environement variable Supplied certificate file
{KSIFILE} Server to server, cluster internal, authentication certificate keystore file name KEYSTORE_FILE_INT Environement variable Supplied certificate file
{KSPWD} Server certificate keystore password kspwd parameter value Parameter value Container configuration file
{TSPWD} Server trusted certificates keystore password tspwd parameter value Parameter value Conteiner configuration file
{KSIPWD} Server to server, cluster internal, authentication certificate keystore password ksipwd parameter value Parameter value Container configuration file
{ARTEMISCLUSTERUSER} Server to server, cluster internal authentication, username clusteruser parameter value Parameter value Container configuration file
{ARTEMISCLUSTERPWD} Server to server, cluster internal authentication, password clusterpwd parameter value Parameter value Container configuration file

 
The other deployment files

Those files are:

  • The server certificate keystore file
  • The trusted certificates keystore file
  • The server to server certificate keystore file
  • artemis-users.properties: Authorized users credentials list
  • artemis-roles.properties: Authorized users/roles mapping
  • The container configuration file that referred by CONTAINER_CONFIG environment variable
Those files are supplied to container at startup through Docker config and Docker secret. These mechanisms allows to easy rotate the contents of the parameters.