Skip to content

Broker Clustered

assimbly edited this page Oct 21, 2021 · 9 revisions

How to set up a clustered broker for ActiveMQ Artemis?

This chapter explains the steps to set up a clustered broker with the following goals:

  • Symmetric cluster: Every node in the cluster is connected to every other node in the cluster.
  • High availability: Continuation of the environment after failure (without message loss).
  • Encryption: Communication between broker nodes and clients is encrypted (with SSL/TLS).
  • Dynamic discovery: Broker nodes and clients can automatically detect each other.
  • Load balancing: Message load get spreaded over the cluster.

Within ActiveMQ Artemis there are often multiple ways to achieve those goals. They are extensively described in the official ActiveMQ documentation:

For the various possible configurations, there are a lot of examples. In this guide we focus on a typical set up for a cluster with Assimbly.

This setup assumes there are two broker nodes on two servers. Thus

  • An Assimbly instance is installed on server1
  • An Assimbly instance is installed on server2

Basic setup

  1. Go to the broker page (Broker --> Manage)
  2. Create a default ActiveMQ Artemis
  3. Give the broker the name "01" and save the broker (all other settings can be default).

Now the broker is a local single node broker. It can already be started and stopped.

Encryption (TLS/SSL)

Certificates

For server1:

  1. Go to settings --> certificates
  2. Create a self-signed certificates and store it in the keystore (give the certificate the DNS name of the server, i.e. server1).
  3. Export the (public) certificate.

For server2:

  1. Go to settings --> certificates
  2. Create a self-signed certificates and store it in the keystore (give the certificate the DNS name of the server, i.e. server2).
  3. Export the (public) certificate.

Now import the exported certificate of server1 in the the certificate store of server 2 (upload --> certificate --> truststore). Also import the exported certifcate of server2 and upload this the certificate store of server1 (upload --> certificate --> truststore).

Cluster password

The broker configuration can normally be changed from within Assimbly or on the server. Both are password protected. It's however also possible to make the password of the broker also encrypted.

  1. Go to setting --> environment variables
  2. Create a encrypted variable

Cluster

Edit broker configuration

  1. Go to broker --> manage --> edit

  2. First thing we do is change the default cluster password:

    admin admin

with the encrypted cluster password:

  <cluster-user>admin</cluster-user>
  <cluster-password>ENC(GAWgr6Mmf8m4xDV43zhm17Qa19lO6lNbhHJWOmOscPFqY7uZsnRV8ikj7S0vMG15)</cluster-password>
  <password-codec>org.assimbly.broker.decoder.AssimblyCodec</password-codec>

if the broker is installed on Linux and ASYNC library (libaio) is installed it is recommend to change the journaltype from:

  <journal-type>NIO</journal-type>

to

  <journal-type>ASYNCIO</journal-type>

Last step of the setup is to enable SSL on the acceptors:

      <acceptors>
        <acceptor name="artemis">tcp://0.0.0.0:61616?sslEnabled=true;keyStorePath=/data/assimbly/broker/.assimbly/security/keystore.jks;keyStorePassword=supersecret;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,STOMP,AMQP,HORNETQ,OPENWIRE</acceptor>
        <acceptor name="amqp">tcp://0.0.0.0:5672?enabledProtocols=TLSv1.2;sslEnabled=true;keyStorePath=/data/assimbly/broker/.assimbly/security/keystore.jks;keyStorePassword=supersecret;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300</acceptor>        
      </acceptors>

Dynamic discovery

Now we can setup dynamic discovery:

  1. Add connector
       <connectors>
           <connector name="netty-connector">tcp://server1:61616?sslEnabled=true;trustStorePath=/data/assimbly/broker/.assimbly/security/truststore.jks;trustStorePassword=supersecret</connector>
        </connectors>

Replace server1 with the server Hostname

Note: the connector acts like a client, so it should point at your truststore. The place of the keystore.jks and truststore.jks in Assimbly is in the base directory. This directory can either be set by command line parameters (otherwise it's store in the user home directory). The base directory is printed on startup.

  1. Add broadcast group
    <broadcast-groups>
       <broadcast-group name="test-broadcast-group">
        <group-address>${udp-address:231.7.7.7}</group-address>
        <group-port>9876</group-port>
        <broadcast-period>2000</broadcast-period>
        <connector-ref>netty-connector</connector-ref>
       </broadcast-group>
    </broadcast-groups>
  1. Add discovery group
      <discovery-groups>
         <discovery-group name="test-discovery-group">
            <group-address>${udp-address:231.7.7.7}</group-address>
            <group-port>9876</group-port>
            <refresh-timeout>10000</refresh-timeout>
         </discovery-group>
      </discovery-groups>

Note: to use dynamic discovery each group address must be unique for every environment. Also there must an open UDP port by the firewall on each server. In this case it's UDP port 9876. To check if the port is configured correctly you can use the netstat command. If that's not the case then you need to configure the firewall. If this is not possible than you can use either jgroups or static connectors (see cluster documentation of ActiveMQ Artemis).

  1. Add cluster connection:
    <cluster-connections>
       <cluster-connection name="test-cluster">
          <connector-ref>netty-connector</connector-ref>
          <retry-interval>500</retry-interval>
          <use-duplicate-detection>false</use-duplicate-detection>
          <message-load-balancing>STRICT</message-load-balancing>
          <max-hops>1</max-hops>
          <discovery-group-ref discovery-group-name="test-discovery-group"/>
       </cluster-connection>
    </cluster-connections>

Load balancing

In the example "message-load-balancing" is set to "STRICT". This means every node get exactly the same amount of messages. For example sending 10 messages to the cluster with two nodes then each nodes gets 5 messages. The other option is to set the parameter to "ON-DEMAND". This is the default parameter where the broker determines itself where the message load goes.

High Availability

There are multiple options for high availibility. In this case we want every node to be active where every node is colocated (both live and backup)

    <ha-policy>
       <replication>
          <colocated>
             <backup-request-retries>44</backup-request-retries>
             <backup-request-retry-interval>33</backup-request-retry-interval>
             <max-backups>3</max-backups>
             <request-backup>false</request-backup>
             <backup-port-offset>33</backup-port-offset>
             <master>
                <group-name>01</group-name>
                <check-for-live-server>true</check-for-live-server>
                <cluster-name>test-cluster</cluster-name>
             </master>
             <slave>
                <group-name>02</group-name>
                <max-saved-replicated-journals-size>22</max-saved-replicated-journals-size>
                <cluster-name>test-cluster</cluster-name>
                <restart-backup>false</restart-backup>
                <scale-down>
                   <discovery-group-ref discovery-group-name="test-discovery-group"/>
                </scale-down>
             </slave>
          </colocated>
       </replication>
    </ha-policy>

Clients

Clients can connect with any of the supported/enabled protocols in the broker acceptors. In our configuration its most likely to connect through a AMQPS component. This is possible when making a Assimbly connector flow using the AMQPS component and a AMQP connection.

Complete examples

Here is a complete example of the broker configuration (broker.xml). You can copy this into the configuration of Assimbly and change the configuration for your environment. Think of:

  • The cluster password
  • The connector server. From localhost to the server name in the connector.
  • Name of the discovery-group

Also various options for the high availibility are added. Default chosen is option 3 (colocated), but master-slave failover (option 1) or live-nodes with scale down (option 2) can also be chosen. Just put option 3 in comment and uncomment the option you need.

Cluster with dynamic discovery

<?xml version='1.0'?>
<!-- Example broker.xml -->

<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:activemq" xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
   <core xmlns="urn:activemq:core">

      <name>01</name>

      <persistence-enabled>true</persistence-enabled>

      <cluster-user>admin</cluster-user>
      <cluster-password>admin</cluster-password>
      
      <journal-type>ASYNCIO</journal-type>

      <paging-directory>/data/assimbly/broker/shared-data/amq/paging</paging-directory>

      <bindings-directory>/data/assimbly/broker/shared-data/amq/bindings</bindings-directory>

      <journal-directory>/data/assimbly/broker/shared-data/amq/journal</journal-directory>

      <large-messages-directory>/data/assimbly/broker/shared-data/amq/large-messages</large-messages-directory>

      <journal-datasync>true</journal-datasync>

      <journal-min-files>2</journal-min-files>

      <journal-pool-files>10</journal-pool-files>

      <journal-file-size>10M</journal-file-size>

      <!-- how often we are looking for how many bytes are being used on the disk in ms -->
      <disk-scan-period>5000</disk-scan-period>

      <!-- once the disk hits this limit the system will block, or close the connection in certain protocols
           that won't support flow control. -->
      <max-disk-usage>100</max-disk-usage>

        
      <acceptors>
        <acceptor name="artemis">tcp://0.0.0.0:61616?sslEnabled=true;keyStorePath=/data/assimbly/broker/.assimbly/security/keystore.jks;keyStorePassword=supersecret;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,STOMP,AMQP,HORNETQ,OPENWIRE</acceptor>

        <acceptor name="amqp">tcp://0.0.0.0:5672?enabledProtocols=TLSv1.2;sslEnabled=true;keyStorePath=/data/assimbly/broker/.assimbly/security/keystore.jks;keyStorePassword=supersecret;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300</acceptor>
        
      </acceptors>

       <connectors>
           <connector name="netty-connector">tcp://localhost:61616?sslEnabled=true;trustStorePath=/data/assimbly/broker/.assimbly/security/truststore.jks;trustStorePassword=supersecret</connector>
        </connectors>

    <broadcast-groups>
       <broadcast-group name="test-broadcast-group">
        <group-address>${udp-address:231.7.7.7}</group-address>
        <group-port>9876</group-port>
        <broadcast-period>2000</broadcast-period>
        <connector-ref>netty-connector</connector-ref>
       </broadcast-group>
    </broadcast-groups>

      <discovery-groups>
         <discovery-group name="test-discovery-group">
            <group-address>${udp-address:231.7.7.7}</group-address>
            <group-port>9876</group-port>
            <refresh-timeout>10000</refresh-timeout>
         </discovery-group>
      </discovery-groups>
      
    <cluster-connections>
       <cluster-connection name="test-cluster">
          <connector-ref>netty-connector</connector-ref>
          <retry-interval>500</retry-interval>
          <use-duplicate-detection>false</use-duplicate-detection>
          <message-load-balancing>STRICT</message-load-balancing>
          <max-hops>1</max-hops>
          <discovery-group-ref discovery-group-name="test-discovery-group"/>
       </cluster-connection>
    </cluster-connections>

    <!-- Option 1: High available Master Node -->
    <!--<ha-policy>
       <replication>
          <master>
             <check-for-live-server>true</check-for-live-server>
          </master>
       </replication>
    </ha-policy>-->

    <!-- Option 2: High available Live Node (load balanced) -->
    <!--
    <ha-policy>
       <live-only>
          <scale-down>
              --><!--
            <connectors>
               <connector-ref>server-live-connector</connector-ref>
            </connectors>--><!--
             <discovery-group-ref discovery-group-name="test-discovery-group"/>
          </scale-down>
       </live-only>
    </ha-policy>
    -->
    
    <!-- Option 3: High available Live Node (load balanced with backup) -->
    <ha-policy>
       <replication>
          <colocated>
             <backup-request-retries>44</backup-request-retries>
             <backup-request-retry-interval>33</backup-request-retry-interval>
             <max-backups>3</max-backups>
             <request-backup>false</request-backup>
             <backup-port-offset>33</backup-port-offset>
             <master>
                <group-name>01</group-name>
                <check-for-live-server>true</check-for-live-server>
                <cluster-name>test-cluster</cluster-name>
             </master>
             <slave>
                <group-name>02</group-name>
                <max-saved-replicated-journals-size>22</max-saved-replicated-journals-size>
                <cluster-name>test-cluster</cluster-name>
                <restart-backup>false</restart-backup>
                <scale-down>
                   <discovery-group-ref discovery-group-name="test-discovery-group"/>
                </scale-down>
             </slave>
          </colocated>
       </replication>
    </ha-policy>


      <security-settings>
         <security-setting match="#">
            <permission type="createAddress" roles="user"/>
            <permission type="createDurableQueue" roles="user"/>
            <permission type="deleteDurableQueue" roles="user"/>
            <permission type="createNonDurableQueue" roles="user"/>
            <permission type="deleteNonDurableQueue" roles="user"/>
            <permission type="consume" roles="user"/>
            <permission type="send" roles="user"/>
         </security-setting>
      </security-settings>
	  
	  <address-settings>
         <address-setting match="ERROR#">
            <dead-letter-address>DLQ</dead-letter-address>
            <expiry-delay>1209600000</expiry-delay>
            <redelivery-delay>1000</redelivery-delay>
            <max-size-bytes>-1</max-size-bytes>
            <message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>PAGE</address-full-policy>
            <auto-create-queues>true</auto-create-queues>
            <auto-create-addresses>true</auto-create-addresses>
            <auto-create-jms-queues>true</auto-create-jms-queues>
            <auto-create-jms-topics>true</auto-create-jms-topics>
         </address-setting>
         <!-- if you define auto-create on certain queues, management has to be auto-create -->
         <address-setting match="activemq.management#">
            <dead-letter-address>DLQ</dead-letter-address>
            <expiry-address>ExpiryQueue</expiry-address>
            <redelivery-delay>0</redelivery-delay>
            <!-- with -1 only the global-max-size is in use for limiting -->
            <max-size-bytes>-1</max-size-bytes>
            <message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>PAGE</address-full-policy>
            <auto-create-queues>true</auto-create-queues>
            <auto-create-addresses>true</auto-create-addresses>
            <auto-create-jms-queues>true</auto-create-jms-queues>
            <auto-create-jms-topics>true</auto-create-jms-topics>
         </address-setting>
         <!--default for catch all-->
         <address-setting match="#">
            <dead-letter-address>DLQ</dead-letter-address>
            <expiry-address>ExpiryQueue</expiry-address>
            <redelivery-delay>0</redelivery-delay>
            <!-- with -1 only the global-max-size is in use for limiting -->
            <max-size-bytes>-1</max-size-bytes>
            <management-message-attribute-size-limit>1024000</management-message-attribute-size-limit>
            <message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>PAGE</address-full-policy>
            <auto-create-queues>true</auto-create-queues>
            <auto-create-addresses>true</auto-create-addresses>
            <auto-create-jms-queues>true</auto-create-jms-queues>
            <auto-create-jms-topics>true</auto-create-jms-topics>
         </address-setting>
      </address-settings>

      <addresses>
         <address name="DLQ">
            <anycast>
               <queue name="DLQ" />
            </anycast>
         </address>
         <address name="ExpiryQueue">
            <anycast>
               <queue name="ExpiryQueue" />
            </anycast>
         </address>

      </addresses>

      <broker-plugins>
         <broker-plugin class-name="org.apache.activemq.artemis.core.server.plugin.impl.LoggingActiveMQServerPlugin">
            <property key="LOG_ALL_EVENTS" value="true"/>
            <property key="LOG_CONNECTION_EVENTS" value="true"/>
            <property key="LOG_SESSION_EVENTS" value="true"/>
            <property key="LOG_CONSUMER_EVENTS" value="true"/>
            <property key="LOG_DELIVERING_EVENTS" value="true"/>
            <property key="LOG_SENDING_EVENTS" value="true"/>
            <property key="LOG_INTERNAL_EVENTS" value="true"/>
         </broker-plugin>
      </broker-plugins>

	  <jmx-management-enabled>true</jmx-management-enabled>
	  
   </core>
</configuration>

Cluster with static discovery

<?xml version='1.0'?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:activemq" xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
   <core xmlns="urn:activemq:core">

      <name>01</name>

      <persistence-enabled>true</persistence-enabled>

      <cluster-user>admin</cluster-user>
      <cluster-password>admin</cluster-password>
      
      <journal-type>ASYNCIO</journal-type>

      <paging-directory>/data/assimbly/broker/shared-data/amq/paging</paging-directory>

      <bindings-directory>/data/assimbly/broker/shared-data/amq/bindings</bindings-directory>

      <journal-directory>/data/assimbly/broker/shared-data/amq/journal</journal-directory>

      <large-messages-directory>/data/assimbly/broker/shared-data/amq/large-messages</large-messages-directory>

      <journal-datasync>true</journal-datasync>

      <journal-min-files>2</journal-min-files>

      <journal-pool-files>10</journal-pool-files>

      <journal-file-size>10M</journal-file-size>

      <!-- how often we are looking for how many bytes are being used on the disk in ms -->
      <disk-scan-period>5000</disk-scan-period>

      <!-- once the disk hits this limit the system will block, or close the connection in certain protocols
           that won't support flow control. -->
      <max-disk-usage>99</max-disk-usage>

        <connectors>
           <connector name="netty-connector">tcp://server1:61616?sslEnabled=true;trustStorePath=/data/assimbly/broker/.assimbly/security/truststore-01.jks;trustStorePassword=supersecret</connector>
        </connectors>
        
      <acceptors>
         <acceptor name="netty-acceptor">tcp://0.0.0.0:61616?protocols=CORE,AMQP,STOMP,HORNETQ,OPENWIRE;sslEnabled=true;keyStorePath=/data/assimbly/broker/.assimbly/security/keystore-01.jks;keyStorePassword=supersecret;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;useEpoll=true</acceptor>
         
         <acceptor name="amqp">tcp://0.0.0.0:5672?protocols=CORE,AMQP;sslEnabled=true;keyStorePath=/data/assimbly/broker/.assimbly/security/keystore-01.jks;keyStorePassword=supersecret;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;useEpoll=true</acceptor>
      </acceptors>

          <! without ssl
        <connectors>
           <connector name="netty-connector">tcp://server1:61616</connector>
        </connectors>
        
      <acceptors>
         <acceptor name="netty-acceptor">tcp://0.0.0.0:61616?protocols=CORE,AMQP,STOMP,HORNETQ,OPENWIRE</acceptor>
         
         <acceptor name="amqp">tcp://0.0.0.0:5672?protocols=CORE,AMQP</acceptor>
      </acceptors> -->
      
    <cluster-connections>
       <cluster-connection name="test-cluster">
          <connector-ref>netty-connector</connector-ref>
          <retry-interval>1000</retry-interval>
          <use-duplicate-detection>false</use-duplicate-detection>
          <message-load-balancing>ON_DEMAND</message-load-balancing>
          <max-hops>1</max-hops>
          <discovery-group-ref discovery-group-name="test-discovery-group"/>
       </cluster-connection>
    </cluster-connections>

      <security-settings>
         <security-setting match="#">
            <permission type="createAddress" roles="user"/>
            <permission type="createDurableQueue" roles="user"/>
            <permission type="deleteDurableQueue" roles="user"/>
            <permission type="createNonDurableQueue" roles="user"/>
            <permission type="deleteNonDurableQueue" roles="user"/>
            <permission type="consume" roles="user"/>
            <permission type="send" roles="user"/>
         </security-setting>
      </security-settings>
	  
	  <address-settings>
         <!-- if you define auto-create on certain queues, management has to be auto-create -->
         <address-setting match="activemq.management#">
            <dead-letter-address>DLQ</dead-letter-address>
            <expiry-address>ExpiryQueue</expiry-address>
            <redelivery-delay>0</redelivery-delay>
            <!-- with -1 only the global-max-size is in use for limiting -->
            <max-size-bytes>-1</max-size-bytes>
            <message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>PAGE</address-full-policy>
            <auto-create-queues>true</auto-create-queues>
            <auto-create-addresses>true</auto-create-addresses>
            <auto-create-jms-queues>true</auto-create-jms-queues>
            <auto-create-jms-topics>true</auto-create-jms-topics>
         </address-setting>
         <!--default for catch all-->
         <address-setting match="#">
            <dead-letter-address>DLQ</dead-letter-address>
            <expiry-address>ExpiryQueue</expiry-address>
            <redelivery-delay>0</redelivery-delay>
            <redistribution-delay>0</redistribution-delay>
            <max-size-bytes>-1</max-size-bytes>
            <management-message-attribute-size-limit>1024000</management-message-attribute-size-limit>
            <message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>PAGE</address-full-policy>
            <auto-create-queues>true</auto-create-queues>
            <auto-create-addresses>true</auto-create-addresses>
            <auto-create-jms-queues>true</auto-create-jms-queues>
            <auto-create-jms-topics>true</auto-create-jms-topics>
         </address-setting>
      </address-settings>

      <addresses>
         <address name="DLQ">
            <anycast>
               <queue name="DLQ" />
            </anycast>
         </address>
         <address name="ExpiryQueue">
            <anycast>
               <queue name="ExpiryQueue" />
            </anycast>
         </address>

      </addresses>

      <broker-plugins>
         <broker-plugin class-name="org.apache.activemq.artemis.core.server.plugin.impl.LoggingActiveMQServerPlugin">
            <property key="LOG_ALL_EVENTS" value="true"/>
            <property key="LOG_CONNECTION_EVENTS" value="true"/>
            <property key="LOG_SESSION_EVENTS" value="true"/>
            <property key="LOG_CONSUMER_EVENTS" value="true"/>
            <property key="LOG_DELIVERING_EVENTS" value="true"/>
            <property key="LOG_SENDING_EVENTS" value="true"/>
            <property key="LOG_INTERNAL_EVENTS" value="true"/>
         </broker-plugin>
      </broker-plugins>

	  <jmx-management-enabled>true</jmx-management-enabled>
	  
   </core>
</configuration>

Federated queues

It's also possible to connect queues without clustering. This is by using federation.

<?xml version='1.0'?>
<!-- Example broker.xml -->

<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:activemq" xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
   <core xmlns="urn:activemq:core">

      <name>01</name>

      <persistence-enabled>true</persistence-enabled>

     <cluster-user>admin</cluster-user>
     <cluster-password>ENC(09V/cQjNtKupfM+WtnB64H7rO6MoYGP9c62xcc9hLbzF6Ze/MmySw5LeyIbVY7KF)</cluster-password>
	 <password-codec>org.assimbly.broker.decoder.AssimblyCodec</password-codec>
      
      <journal-type>NIO</journal-type>

      <paging-directory>/data/assimbly/broker/shared-data/amq/paging</paging-directory>

      <bindings-directory>/data/assimbly/broker/shared-data/amq/bindings</bindings-directory>

      <journal-directory>/data/assimbly/broker/shared-data/amq/journal</journal-directory>

      <large-messages-directory>/data/assimbly/broker/shared-data/amq/large-messages</large-messages-directory>

      <journal-datasync>true</journal-datasync>

      <journal-min-files>2</journal-min-files>

      <journal-pool-files>10</journal-pool-files>

      <journal-file-size>10M</journal-file-size>

      <!-- how often we are looking for how many bytes are being used on the disk in ms -->
      <disk-scan-period>5000</disk-scan-period>

      <!-- once the disk hits this limit the system will block, or close the connection in certain protocols
           that won't support flow control. -->
      <max-disk-usage>99</max-disk-usage>

        <connectors>
           <connector name="netty-connector">tcp://server1:61616?sslEnabled=true;trustStorePath=/data/assimbly/broker/.assimbly/security/truststore.jks;trustStorePassword=supersecret</connector>
           <connector name="server-01-connector">tcp://server1:61616?sslEnabled=true;trustStorePath=/data/assimbly/broker/.assimbly/security/truststore.jks;trustStorePassword=supersecret</connector>
           <connector name="server-02-connector">tcp://server2:61616?sslEnabled=true;trustStorePath=/data/assimbly/broker/.assimbly/security/truststore.jks;trustStorePassword=supersecret</connector>
        </connectors>
        
      <acceptors>
         <acceptor name="netty-acceptor">tcp://0.0.0.0:61616?protocols=CORE,AMQP,STOMP,HORNETQ,OPENWIRE,MQTT;sslEnabled=true;keyStorePath=/data/assimbly/broker/.assimbly/security/keystore.jks;keyStorePassword=supersecret;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>
         <acceptor name="amqp">tcp://0.0.0.0:5672?protocols=CORE,AMQP;sslEnabled=true;keyStorePath=/data/assimbly/broker/.assimbly/security/keystore.jks;keyStorePassword=supersecret;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>
      </acceptors>

      <security-settings>
         <security-setting match="#">
            <permission type="createAddress" roles="user"/>
            <permission type="createDurableQueue" roles="user"/>
            <permission type="deleteDurableQueue" roles="user"/>
            <permission type="createNonDurableQueue" roles="user"/>
            <permission type="deleteNonDurableQueue" roles="user"/>
            <permission type="consume" roles="user"/>
            <permission type="send" roles="user"/>
         </security-setting>
      </security-settings>
	  
	  <address-settings>
         <!-- if you define auto-create on certain queues, management has to be auto-create -->
         <address-setting match="activemq.management#">
            <dead-letter-address>DLQ</dead-letter-address>
            <expiry-address>ExpiryQueue</expiry-address>
            <redelivery-delay>0</redelivery-delay>
            <!-- with -1 only the global-max-size is in use for limiting -->
            <max-size-bytes>-1</max-size-bytes>
            <message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>PAGE</address-full-policy>
            <auto-create-queues>true</auto-create-queues>
            <auto-create-addresses>true</auto-create-addresses>
            <auto-create-jms-queues>true</auto-create-jms-queues>
            <auto-create-jms-topics>true</auto-create-jms-topics>
         </address-setting>
         <!--default for catch all-->
         <address-setting match="#">
            <dead-letter-address>DLQ</dead-letter-address>
            <expiry-address>ExpiryQueue</expiry-address>
            <redelivery-delay>0</redelivery-delay>
            <redistribution-delay>0</redistribution-delay>
            <max-size-bytes>-1</max-size-bytes>
            <management-message-attribute-size-limit>1024000</management-message-attribute-size-limit>
            <message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>PAGE</address-full-policy>
            <auto-create-queues>true</auto-create-queues>
            <auto-create-addresses>true</auto-create-addresses>
            <auto-create-jms-queues>true</auto-create-jms-queues>
            <auto-create-jms-topics>true</auto-create-jms-topics>
         </address-setting>
      </address-settings>

      <addresses>
         <address name="DLQ">
            <anycast>
               <queue name="DLQ" />
            </anycast>
         </address>
         <address name="ExpiryQueue">
            <anycast>
               <queue name="ExpiryQueue" />
            </anycast>
         </address>

      </addresses>

      <federations>
         <federation name="test-01-federation" user="admin" password="admin">
            <upstream name="test-02-upstream" priority-adjustment="0">
               <circuit-breaker-timeout>1000</circuit-breaker-timeout>
               <share-connection>true</share-connection>
                <static-connectors>
                  <connector-ref>server-02-connector</connector-ref>
               </static-connectors>
               <policy ref="policyTest"/>
            </upstream>

            <policy-set name="policyTest">
               <policy ref="queue-federation" />
            </policy-set>

            <queue-policy name="queue-federation" >
               <include queue-match="#" address-match="#" />
            </queue-policy>
         </federation>
      </federations>

      <broker-plugins>
         <broker-plugin class-name="org.apache.activemq.artemis.core.server.plugin.impl.LoggingActiveMQServerPlugin">
            <property key="LOG_ALL_EVENTS" value="true"/>
            <property key="LOG_CONNECTION_EVENTS" value="true"/>
            <property key="LOG_SESSION_EVENTS" value="true"/>
            <property key="LOG_CONSUMER_EVENTS" value="true"/>
            <property key="LOG_DELIVERING_EVENTS" value="true"/>
            <property key="LOG_SENDING_EVENTS" value="true"/>
            <property key="LOG_INTERNAL_EVENTS" value="true"/>
         </broker-plugin>
      </broker-plugins>

	  <jmx-management-enabled>true</jmx-management-enabled>
	  
   </core>
   
</configuration>
Clone this wiki locally