activemq-artemis/examples/features/ha/colocated-failover
Domenico Francesco Bruscino 32bf9680f2 [maven-release-plugin] prepare for next development iteration 2020-08-24 16:03:24 +02:00
..
src/main ARTEMIS-1562 Refactor example documentation 2017-12-15 14:54:16 +00:00
pom.xml [maven-release-plugin] prepare for next development iteration 2020-08-24 16:03:24 +02:00
readme.md ARTEMIS-1562 Refactor example documentation 2017-12-15 14:54:16 +00:00

readme.md

JMS Colocated Failover Shared Store Example

To run the example, simply type mvn verify from this directory. This example will always spawn and stop multiple brokers.

This example demonstrates how you can colocate live and backup brokers in the same VM. We do this by creating an HA Policy that is colocated. Colocated means that backup brokers can be created and maintained by live brokers on behalf of other live brokers requesting a backup. In this example we create a colocated shared store broker.

This example starts 2 live brokers each with a backup broker that backs up the other live broker.

The first live broker will be killed and the backup in the second will become live

The following shows how to configure the live brokers to request and allow backups to be deployed

<ha-policy>
   <shared-store>
      <colocated>
         <backup-port-offset>100</backup-port-offset>
         <backup-request-retries>-1</backup-request-retries>
         <backup-request-retry-interval>2000</backup-request-retry-interval>
         <max-backups>1</max-backups>
         <request-backup>true</request-backup>
         <master/>
         <slave/>
      </colocated>
   </shared-store>
</ha-policy>

notice that we have used a template to set some sensible defaults but overridden the backup strategy so back ups are full brokers.