activemq
Installs and configures Apache ActiveMQ Artemis / Red Hat AMQ broker services.
Dependencies
The role depends on the following collections:
To install, from the collection root directory, run:
ansible-galaxy collections install -r requirements.yml
Versions
AMQ 7 Broker and Clients LTS Support Policy: https://access.redhat.com/articles/7009946
Role Defaults
Install options
Variable |
Description |
Default |
---|---|---|
|
Apache Artemis version |
|
|
Apache Artemis install archive filename |
|
|
Apache Artemis download URL |
|
|
Apache Artemis Installation path |
|
|
Root installation directory |
|
|
Perform an offline installation |
|
|
Path local to controller for offline/download of install archives |
|
Service configuration
Variable |
Description |
Default |
---|---|---|
|
POSIX user running the service |
|
|
POSIX group running the service |
|
|
PID file for service |
|
|
systemd service unit name |
|
|
Service user home directory, defaults to artemis installation directory |
|
Common configuration
Variable |
Description |
Default |
---|---|---|
|
Name of broker instance to deploy |
|
|
Username for accessing the broker instance |
|
|
Password for accessing the broker instance |
|
|
Whether to allow anonymous logins to the instance |
|
|
Whether to install and configure firewalld |
|
|
Service bind address |
|
|
Service hostname |
|
|
Service http port serving console and REST api |
|
|
URL for jolokia REST api |
|
|
URL for console service |
|
|
RPM package to install for the service |
|
|
Additional JVM options for the service |
|
|
Main port for the broker instance |
|
|
hornetq port for the broker instance |
|
|
AMQP port for the broker instance |
|
|
MQTT port for the broker instance |
|
|
STOMP port for the broker instance |
|
|
Whether to enable port offset |
|
|
Port offset for all default ports |
|
|
Use shared filesystem directory for storage |
|
|
Absolute path of shared directory |
|
|
Whether the systemd unit must require a mounted path (only when using shared storage) |
|
|
Disable automatic creation of destination |
|
|
Queue names comma separated |
|
|
Periodic refresh of configuration in milliseconds; can be disabled by specifying -1 |
|
|
Fully qualified class name and its parameters for the Decoder used to decode the masked password. Ignored if |
|
|
Whether passwords in server configuration need to be masked. |
|
|
List of jars to install in activemq classpath, read from playbook files lookup paths |
|
|
Name of algorithm used for masking password, will be passed to custom codec |
|
|
Number of iterations for masking password, will be passed to custom codec |
|
|
Properties file to allow updates and additions to the broker configuration after any xml has been parsed |
|
|
Whether or not to enable XInclude modular configuration of broker.xml |
|
|
The value to use in bootstrap.xml for web console binding |
|
LDAP authN/authZ
Variable |
Description |
Default |
---|---|---|
|
Whether to enable property based JAAS config |
|
|
Location of JAAS login.config template; by default use template provided with role |
|
|
Whether to enable LDAP based JAAS config |
|
|
URL for LDAP server connection” |
|
|
Bind username for LDAP server” |
|
|
Bind user password for LDAP server” |
|
|
Optional password codec class for bind user password” |
|
|
Protocol for LDAP connection” |
|
|
Type of LDAP server authentication” |
|
|
Base for user search |
|
|
User attribute |
|
|
Whether to enable subtree user search |
|
|
Base for role search |
|
|
Role attribute |
|
|
Role search attribute |
|
|
Whether to enable subtree role search |
|
|
Specify how to handle referrals; valid values: ignore, follow, throw |
|
|
Whether to enable role expansion functionality; if enabled, then roles within roles will be found |
|
|
An LDAP search filter which is applied to the subtree selected by roleBase |
|
Journal configuration
Variable |
Description |
Default |
---|---|---|
|
Number of messages before all addresses will enter into their Full Policy configured. It works in conjunction with |
|
|
Size (in bytes) before all addresses will enter into their Full Policy configured upon messages being produced. Supports byte notation like ‘K’, ‘Mb’, ‘MiB’, ‘GB’, etc. |
|
|
The activemq data directory path |
|
|
Whether to use the file based journal for persistence |
|
|
Whether to persist cache IDs to the journal |
|
|
The duplicate detection circular cache size |
|
|
Journal type, valid values are [ |
|
|
The directory to store paged messages in |
|
|
The folder in use for the bindings folder |
|
|
The directory to store the journal files in |
|
|
The directory to store large messages |
|
|
Whether to use msync/fsync on journal operations |
|
|
How many journal files to pre-create |
|
|
The upper threshold of the journal file pool, -1 means no Limit |
|
|
The block size by the device |
|
|
The size (in bytes) of each journal file |
|
|
The Flush timeout for the journal buffer |
|
|
The maximum number of write requests that can be in the ASYNCIO queue at any one time |
|
|
The size of the internal buffer on the journal in KB |
|
|
The interval where the disk is scanned for percentual usage |
|
|
The max percentage of data we should use from disks. The System will block while the disk is full |
|
|
Whether to enable JDBC persistence |
|
|
The full JDBC connection URL for your database server |
|
|
The name of the table in which bindings data will be persisted |
|
|
The name of the table in which bindings data will be persisted |
|
|
The name of the table in which messages and related data will be persisted |
|
|
The fully qualified class name of the desired database Driver |
|
Critical Analyzer
Variable |
Description |
Default |
---|---|---|
|
Should the broker detect dead locks and other issues |
|
|
Timeout used to do the critical analysis (milliseconds) |
|
|
Time used to check the response times (milliseconds) |
|
|
Should the server log, be halted or shutdown upon failures (one of LOG, HALT, SHUTDOWN) |
|
Acceptors / connectors
Variable |
Description |
Default |
---|---|---|
|
Acceptors configuration; list of |
Generate same configuration as |
|
Connectors configuration; list of |
Generate same configuration as |
Sample acceptor:
- name: amqp
scheme: tcp
bind_address: {{ activemq_host }}
bind_port: {{ activemq_port_amqp }}
parameters:
tcpSendBufferSize: 1048576
tcpReceiveBufferSize: 1048576
protocols: AMQP
useEpoll: true
amqpMinLargeMessageSize: 102400
amqpCredits: 1000
amqpLowCredits: 300
amqpDuplicateDetection: true
Sample connector with TLS:
- name: amqp
scheme: tcp
address: 172.168.10.43
port: 61616
parameters:
tcpSendBufferSize: 1048576
tcpReceiveBufferSize: 1048576
protocols: CORE
useEpoll: true
sslEnabled: True
keyStorePath: "{{ activemq_tls_keystore_dest }}"
keyStorePassword: "{{ activemq_tls_keystore_password }}"
trustStorePath: "{{ activemq_tls_truststore_dest }}"
trustStorePassword: "{{ activemq_tls_truststore_password }}"
verifyHost: False
Sample in-vm acceptor:
- name: in_vm
scheme: vm
Addresses configuration
Variable |
Description |
Default |
---|---|---|
|
Addresses/queue configuration; list of |
Generate same configuration as |
Sample addresses:
- name: ExpiryQueue
anycast:
- name: ExpiryQueue
- name: Virtual
anycast:
- name: Virtual
filter: "discard='true'"
max_consumers: 5
consumers_before_dispatch: 1
Address settings
Variable |
Description |
Default |
---|---|---|
|
Address settings configuration; list of |
“Generate same configuration as |
Sample address settings:
- match: activemq.management#
parameters:
dead_letter_address: DLQ
expiry_address: ExpiryQueue
redelivery_delay: 0
max_size_bytes: -1
message_counter_history_day_limit: 10
address_full_policy: PAGE
auto_create_queues: true
auto_create_addresses: true
auto_create_jms_queues: true
auto_create_jms_topics: true
The parameters are snake_cased
variants of the artemis configuration schema elements, which are kebab-cased
(ie. dead-letter-address
-> dead_letter_address
).
Diverts configuration
Variable |
Description |
Default |
---|---|---|
|
Diverts configuration; list of |
|
Sample divert:
- name: SAMPLEDIVERT
address: FROMQUEUE
forwarding_address: TOQUEUE
routing_type: ANYCAST
filter: "msgType LIKE '%ff%'"
exclusive: True
Clustering
Variable |
Description |
Default |
---|---|---|
|
Whether to enable clustering |
|
|
Whether or not to enable clustering (cluster-connections) |
|
|
Cluster username |
|
|
Cluster user password |
|
|
Cluster max hops |
|
|
Policy for cluster load balancing |
|
|
Whether or not clustering supports scale-down” |
|
|
Instance role for high availability |
|
|
Enables replication |
|
|
Designate instance as replicated node |
|
|
Cluster discovery: [ |
|
|
The list of cluster connection names from the connectors list, when |
|
|
The NIC name to be used for cluster IPv4 addresses (ie. ‘eth0’) |
|
|
Whether systemd unit should wait for activemq port before returning |
|
|
Whether systemd unit should wait for service to be up in logs |
|
|
How long to wait for service to be alive (seconds) |
|
|
Activation delay for service systemd unit |
|
|
The string to match in the logs when |
|
|
The string to match in the logs when |
|
|
The port number to wait for when |
|
|
Whether or not to expand the environment in the sysconfig file. If true, environment file is sourced and the activemq process is started in a shell |
|
|
Whether a server will automatically stop when another places a request to take over its place |
|
|
Will this backup server become active on a normal server shutdown |
|
|
Will this server, if a backup, restart once it has been stopped because of failback or scaling down |
|
|
Whether to check the cluster for a live server using our own server ID when starting up. This option is only necessary for performing ‘fail-back’ on replicating servers |
|
|
Name of the cluster configuration to use for replication. This setting is only necessary in case you configure multiple cluster connections |
|
|
With replication, if set, remote backup servers will only pair with primary servers with matching group-name |
|
|
Whether this broker should vote to remain active if replication is lost. Only valid for quorum voting. |
|
|
The quorum size used for voting after replication loss, -1 means use the current cluster size. Only valid for quorum voting |
|
Multi-site fault-tolerance (AMQP broker connections)
Variable |
Description |
Default |
---|---|---|
|
AMQP broker connections configuration; list of |
|
Sample of mirroring operation:
activemq_broker_connections:
- uri: 'tcp://<hostname>:<port>'
name: DC2
sync: true
operations:
- type: mirror
parameters:
queue_removal: false
Sample for sender-receiver operation:
activemq_broker_connections:
- uri: 'tcp://<hostname>:<port>?<options>'
name: other-server
user: user
password: password
operations:
- type: sender
parameters:
address_match: 'queues.#'
- type: receiver
parameters:
address_match: 'remotequeues.#'
Note: operations parameters keys are using underscore (address_match:
) instead of dash (address-match:
). Dash works only if using single quotes (ie. 'address-match':
)
Note: the local queues for remotequeues.#
need to be created on this broker.
Network check
Variable |
Description |
Default |
---|---|---|
|
Whether to enable network check |
|
|
How often to check network reachability (ms) |
|
|
Connection timeout for network checks (ms) |
|
|
The addresses to use for checking; comma separated list, no spaces, just DNS or IPs |
|
|
The network card to use for network checking |
|
|
The ping command to network check IPv4 |
|
|
The ping command to network check IPv6 |
|
TLS/SSL protocol
Variable |
Description |
Default |
---|---|---|
|
Whether to enable TLS |
|
|
Path for installation of truststore |
|
|
Whether to enable TLS mutual auth, requires TLS enabled |
|
|
Path for installation of truststore |
|
See Role Variables below for additional TLS/SSL settings.
Logging
Variable |
Description |
Default |
---|---|---|
|
Whether to enable audit file logging |
|
|
Root logging level |
|
|
Logging level for org.apache.activemq.artemis.core.server |
|
|
Logging level for org.apache.activemq.artemis.journal |
|
|
Logging level for org.apache.activemq.artemis.utils |
|
|
Logging level for org.apache.activemq.artemis.utils.critical |
|
|
Logging level for org.apache.activemq.artemis.jms |
|
|
Logging level for org.apache.activemq.artemis.integration.bootstrap |
|
|
Logging level for org.eclipse.jetty |
|
|
Logging level for org.apache.curator |
|
|
Logging level for org.apache.zookeeper |
|
|
Number of rollover log files |
|
|
Number of rollover audit log files |
|
|
Optional subdirectory of any playbook template lookup directories for the logging facility configuration |
|
|
Whether to keep the custom template filename or use the default |
|
|
Path for main logfile relative to instance directory |
|
Broker plugins
Variable |
Description |
Default |
---|---|---|
|
The list of broker-plugins configurations (dict: { class_name, properties(dict) }) |
|
Sample:
activemq_broker_plugins:
- class_name: org.apache.activemq.artemis.core.server.plugin.impl.LoggingActiveMQServerPlugin
properties:
LOG_DELIVERING_EVENTS: true
LOG_SENDING_EVENTS: true
- class_name: org.apache.activemq.artemis.core.server.plugin.impl.NotificationActiveMQServerPlugin
properties:
SEND_SESSION_NOTIFICATIONS: true
Other options
Variable |
Description |
Default |
---|---|---|
|
Enable Native IO using libaio |
|
|
Whether to disable AMQP protocol |
|
|
Whether to disable HORNETQ protocol |
|
|
Whether to disable MQTT protocol |
|
|
Whether to disable STOMP protocol |
|
|
Port for prometheus JMX exporter to listen |
|
|
JMX exporter configuration path |
|
|
Enable install and configuration of prometheus-jmx-exporter |
|
|
The rpm package name providing JMX exporter |
|
|
Enable install and configuration of prometheus metrics plugin |
|
|
Human readable service name |
|
|
Broker instance configuration directory |
|
|
Broker instance configuration file |
|
|
Filename of custom broker xml configuration file to be deployed |
|
|
Filename of custom systemd unit template to be deployed |
|
|
Whether to enable the message counters |
|
|
The sample period (in ms) to use for message counters |
|
|
How many days to keep message counter history |
|
User / Role configuration
Variable |
Description |
Default |
---|---|---|
|
List of users the create with role; user is not created if password empty. List of (user,password,role) dicts |
|
|
List of roles to create. List of (role,permissions) dicts where permissions is a list of amq broker permissions |
|
|
Artemis role for hawtio console access |
|
|
Management console access methods for roles in |
|
|
Management console access methods per domain for roles in |
|
|
List of CORS allow origin setting for jolokia |
|
|
Whether to enforce strict checking for CORS |
|
Sample user/role configuration with one admin, a consumer and a producer:
activemq_hawtio_role: admin
activemq_users:
- user: amq
password: amqbrokerpass
roles: [ admin ]
- user: other
password: amqotherpass
roles: [ consumer, producer ]
activemq_roles:
- name: admin
permissions: [ createNonDurableQueue, deleteNonDurableQueue, createDurableQueue, deleteDurableQueue, createAddress, deleteAddress, consume, browse, send, manage ]
- name: consumer
match: topics.#
permissions: [ consume, browse ]
- name: producer
match: topics.#
permissions: [ send, browse ]
Role Variables
Variable |
Description |
Required |
---|---|---|
|
|
|
|
Keystore path for TLS connections |
when |
|
Keystore password for TLS connections |
when |
|
Truststore to use for TLS mutual authentication |
when |
|
Password for truststore |
when |
Example Playbook
---
- hosts: all
collections:
- middleware_automation.amq
roles:
- activemq