ansible-middleware / amq

A collection to manage AMQ brokers
Apache License 2.0
20 stars 11 forks source link

New parameter value to explicitly list `cluster-connections` #168

Closed guidograzioli closed 2 months ago

guidograzioli commented 2 months ago

Add a new choice in activemq_cluster_discovery: provided, which leverages the new activemq_cluster_connections parameter to build the broker cluster-connections reusing the already defined activemq_connectors names.

Variable Description Default
activemq_cluster_discovery Cluster discovery: [jgroups (shared file ping), multicast (UDP), static (node list), provided (use activemq_cluster_connections)] static
activemq_cluster_connections The list of cluster connection names from the connectors list, when activemq_cluster_discovery = provided []

When setting the new provided value, it is possible to define:

activemq_connectors:
  - name: master-AMQ01
    scheme: tcp
    address: amq01-primary.domain.tld
    port: 61321
  - name: slave-AMQ01
    scheme: tcp
    address: amq01-backup.domain.tld
    port: 61321
  - name: master-AMQ02
    scheme: tcp
    address: amq02-primary.domain.tld
    port: 61322
  - name: slave-AMQ02
    scheme: tcp
    address: amq02-backup.domain.tld
    port: 61322
  - name: master-AMQ03
    scheme: tcp
    address: amq03-primary.domain.tld
    port: 61323
  - name: slave-AMQ03
    scheme: tcp
    address: amq03-backup.domain.tld
    port: 61323

and then decoratively list the connector-refs as:

activemq_cluster_discovery: provided
activemq_cluster_connections:
  - name: master-AMQ01
  - name: slave-AMQ01
  - name: master-AMQ02
  - name: slave-AMQ02
  - name: master-AMQ03
  - name: slave-AMQ03

Note: the first defined cluster connection is important when replicating with more that one connector, and check-for-active-server is enabled. See "cluster-name" documentation under: https://activemq.apache.org/components/artemis/documentation/latest/ha.html#additional-parameters-4