This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch development
in repository https://gitbox.apache.org/repos/asf/artemis-examples.git

commit ec8ee0c2e44736fb2fc051ac6df5e3ac9efc0b05
Author: Clebert Suconic <[email protected]>
AuthorDate: Tue Mar 3 16:28:46 2026 -0500

    ARTEMIS-5925 Upgraded examples on Mirorring to the new Lock Coordinator
    
    I am naming this configuration as star mirroring.
    
    Disclaimer: I used Claude Sonet to create the documentation and examples
    provided here. I reviewed everything provided and my prompt was very
    specific on what to include here.
---
 .../pom.xml                                        |   8 +-
 .../readme.md                                      |   2 +-
 .../jms/example/HAWithDualMirrorExample.java}      |   6 +-
 .../src/main/resources/artemis/server0/broker.xml  |   0
 .../src/main/resources/artemis/server1/broker.xml  |   0
 .../pom.xml                                        |  21 ++-
 .../ha-with-star-mirror/readme.md                  | 145 +++++++++++++++++++++
 .../jms/example/HAWithStarMirrorExample.java}      |  23 ++--
 .../src/main/resources/artemis/server0/broker.xml  |  10 +-
 .../src/main/resources/artemis/server1/broker.xml  |  13 +-
 .../src/main/resources/artemis/server2}/broker.xml |  18 ++-
 examples/features/broker-connection/pom.xml        |   6 +-
 12 files changed, 213 insertions(+), 39 deletions(-)

diff --git a/examples/features/broker-connection/ha-with-mirroring/pom.xml 
b/examples/features/broker-connection/ha-with-dual-mirror/pom.xml
similarity index 95%
copy from examples/features/broker-connection/ha-with-mirroring/pom.xml
copy to examples/features/broker-connection/ha-with-dual-mirror/pom.xml
index a196f56c..66caf261 100644
--- a/examples/features/broker-connection/ha-with-mirroring/pom.xml
+++ b/examples/features/broker-connection/ha-with-dual-mirror/pom.xml
@@ -27,9 +27,9 @@ under the License.
       <version>2.53.0-SNAPSHOT</version>
    </parent>
 
-   <artifactId>ha-with-mirroring</artifactId>
+   <artifactId>ha-with-dual-mirror</artifactId>
    <packaging>jar</packaging>
-   <name>Apache Artemis Example - HA with Mirroring</name>
+   <name>Apache Artemis Example - HA with Dual Mirror</name>
 
    <properties>
       <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
@@ -88,7 +88,7 @@ under the License.
                      <goal>runClient</goal>
                   </goals>
                   <configuration>
-                     
<clientClass>org.apache.artemis.jms.example.HAWithMirroringExample</clientClass>
+                     
<clientClass>org.apache.artemis.jms.example.HAWithDualMirrorExample</clientClass>
                      <args>
                         <param>${basedir}/target/server0</param>
                         <param>${basedir}/target/server1</param>
@@ -99,7 +99,7 @@ under the License.
             <dependencies>
                <dependency>
                   
<groupId>org.apache.artemis.examples.broker-connection</groupId>
-                  <artifactId>ha-with-mirroring</artifactId>
+                  <artifactId>ha-with-dual-mirror</artifactId>
                   <version>${project.version}</version>
                </dependency>
             </dependencies>
diff --git a/examples/features/broker-connection/ha-with-mirroring/readme.md 
b/examples/features/broker-connection/ha-with-dual-mirror/readme.md
similarity index 98%
rename from examples/features/broker-connection/ha-with-mirroring/readme.md
rename to examples/features/broker-connection/ha-with-dual-mirror/readme.md
index 086bf299..a8c2bc3e 100644
--- a/examples/features/broker-connection/ha-with-mirroring/readme.md
+++ b/examples/features/broker-connection/ha-with-dual-mirror/readme.md
@@ -1,4 +1,4 @@
-# High Availability with Mirroring and Distributed Locks
+# High Availability with Dual Mirror and Distributed Locks
 
 To run the example, simply type **mvn verify** from this directory.
 
diff --git 
a/examples/features/broker-connection/ha-with-mirroring/src/main/java/org/apache/artemis/jms/example/HAWithMirroringExample.java
 
b/examples/features/broker-connection/ha-with-dual-mirror/src/main/java/org/apache/artemis/jms/example/HAWithDualMirrorExample.java
similarity index 93%
copy from 
examples/features/broker-connection/ha-with-mirroring/src/main/java/org/apache/artemis/jms/example/HAWithMirroringExample.java
copy to 
examples/features/broker-connection/ha-with-dual-mirror/src/main/java/org/apache/artemis/jms/example/HAWithDualMirrorExample.java
index fb0b8b80..32f228ee 100644
--- 
a/examples/features/broker-connection/ha-with-mirroring/src/main/java/org/apache/artemis/jms/example/HAWithMirroringExample.java
+++ 
b/examples/features/broker-connection/ha-with-dual-mirror/src/main/java/org/apache/artemis/jms/example/HAWithDualMirrorExample.java
@@ -32,7 +32,7 @@ import org.apache.activemq.artemis.utils.FileUtil;
 /**
  * Example of live and replicating backup pair using mirroring and a 
distributed lock from the Lock Coordinator
  */
-public class HAWithMirroringExample {
+public class HAWithDualMirrorExample {
 
    private static Process server0;
 
@@ -49,9 +49,9 @@ public class HAWithMirroringExample {
       try {
 
          // Start the two servers
-         server0 = ServerUtil.startServer(args[0], 
HAWithMirroringExample.class.getSimpleName() + "-peer0", 0, 0);
+         server0 = ServerUtil.startServer(args[0], 
HAWithDualMirrorExample.class.getSimpleName() + "-peer0", 0, 0);
          Thread.sleep(2_000);
-         server1 = ServerUtil.startServer(args[1], 
HAWithMirroringExample.class.getSimpleName() + "-peer1", 1, 0);
+         server1 = ServerUtil.startServer(args[1], 
HAWithDualMirrorExample.class.getSimpleName() + "-peer1", 1, 0);
 
          // We connect to the broker holding the lock on the distributed lock
          ConnectionFactory factory = new 
org.apache.qpid.jms.JmsConnectionFactory(
diff --git 
a/examples/features/broker-connection/ha-with-mirroring/src/main/resources/artemis/server0/broker.xml
 
b/examples/features/broker-connection/ha-with-dual-mirror/src/main/resources/artemis/server0/broker.xml
similarity index 100%
copy from 
examples/features/broker-connection/ha-with-mirroring/src/main/resources/artemis/server0/broker.xml
copy to 
examples/features/broker-connection/ha-with-dual-mirror/src/main/resources/artemis/server0/broker.xml
diff --git 
a/examples/features/broker-connection/ha-with-mirroring/src/main/resources/artemis/server1/broker.xml
 
b/examples/features/broker-connection/ha-with-dual-mirror/src/main/resources/artemis/server1/broker.xml
similarity index 100%
copy from 
examples/features/broker-connection/ha-with-mirroring/src/main/resources/artemis/server1/broker.xml
copy to 
examples/features/broker-connection/ha-with-dual-mirror/src/main/resources/artemis/server1/broker.xml
diff --git a/examples/features/broker-connection/ha-with-mirroring/pom.xml 
b/examples/features/broker-connection/ha-with-star-mirror/pom.xml
similarity index 83%
rename from examples/features/broker-connection/ha-with-mirroring/pom.xml
rename to examples/features/broker-connection/ha-with-star-mirror/pom.xml
index a196f56c..7ad1735b 100644
--- a/examples/features/broker-connection/ha-with-mirroring/pom.xml
+++ b/examples/features/broker-connection/ha-with-star-mirror/pom.xml
@@ -27,9 +27,9 @@ under the License.
       <version>2.53.0-SNAPSHOT</version>
    </parent>
 
-   <artifactId>ha-with-mirroring</artifactId>
+   <artifactId>ha-with-star-mirror</artifactId>
    <packaging>jar</packaging>
-   <name>Apache Artemis Example - HA with Mirroring</name>
+   <name>Apache Artemis Example - HA with Star Mirror</name>
 
    <properties>
       <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
@@ -82,16 +82,29 @@ under the License.
                      
<configuration>${basedir}/target/classes/artemis/server1</configuration>
                   </configuration>
                </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <!-- this makes it easier in certain envs -->
+                     <instance>${basedir}/target/server2</instance>
+                     <allowAnonymous>true</allowAnonymous>
+                     
<configuration>${basedir}/target/classes/artemis/server2</configuration>
+                  </configuration>
+               </execution>
                <execution>
                   <id>runClient</id>
                   <goals>
                      <goal>runClient</goal>
                   </goals>
                   <configuration>
-                     
<clientClass>org.apache.artemis.jms.example.HAWithMirroringExample</clientClass>
+                     
<clientClass>org.apache.artemis.jms.example.HAWithStarMirrorExample</clientClass>
                      <args>
                         <param>${basedir}/target/server0</param>
                         <param>${basedir}/target/server1</param>
+                        <param>${basedir}/target/server2</param>
                      </args>
                   </configuration>
                </execution>
@@ -99,7 +112,7 @@ under the License.
             <dependencies>
                <dependency>
                   
<groupId>org.apache.artemis.examples.broker-connection</groupId>
-                  <artifactId>ha-with-mirroring</artifactId>
+                  <artifactId>ha-with-star-mirror</artifactId>
                   <version>${project.version}</version>
                </dependency>
             </dependencies>
diff --git a/examples/features/broker-connection/ha-with-star-mirror/readme.md 
b/examples/features/broker-connection/ha-with-star-mirror/readme.md
new file mode 100644
index 00000000..d03fe6ff
--- /dev/null
+++ b/examples/features/broker-connection/ha-with-star-mirror/readme.md
@@ -0,0 +1,145 @@
+# High Availability with Star Mirror and Distributed Locks
+
+To run the example, simply type **mvn verify** from this directory.
+
+This example demonstrates how to achieve high availability (HA) using star 
topology mirroring combined with distributed locks from the Lock Coordinator 
feature. The distributed locks ensure that only one broker accepts client 
connections at a time, providing automatic failover without split-brain 
scenarios across three brokers.
+
+## Overview
+
+This example configures three brokers (server0, server1, and server2) that:
+- Mirror all messaging operations to each other using broker connections in a 
star topology
+- Share a distributed file-based lock to coordinate which broker accepts 
client connections
+- Automatically failover client connections when the active broker fails
+- Use lock coordinator on broker connections to ensure mirroring only happens 
when the broker is active
+
+## How It Works
+
+### Star Topology Mirroring Configuration
+
+All three brokers are configured with mirroring to the other two brokers using 
AMQP broker connections. The key feature is using the **lock-coordinator 
attribute on broker connections**, which ensures that mirroring only happens 
when the broker holding the lock is active.
+
+**server0/broker.xml:**
+```xml
+<broker-connections>
+   <amqp-connection uri="tcp://localhost:61001" name="mirrorB" 
retry-interval="2000" lock-coordinator="clients-lock">
+      <mirror sync="true"/>
+   </amqp-connection>
+   <amqp-connection uri="tcp://localhost:61002" name="mirrorC" 
retry-interval="2000" lock-coordinator="clients-lock">
+      <mirror sync="true"/>
+   </amqp-connection>
+</broker-connections>
+```
+
+**Note:** The first server (server0) is configured with `sync="true"` to 
demonstrate how synchronous mirroring would work in an HA scenario like this.
+
+**server1/broker.xml:**
+```xml
+<broker-connections>
+   <amqp-connection uri="tcp://localhost:61000" name="mirrorA" 
retry-interval="2000" lock-coordinator="clients-lock">
+      <mirror sync="false"/>
+   </amqp-connection>
+   <amqp-connection uri="tcp://localhost:61002" name="mirrorC" 
retry-interval="2000" lock-coordinator="clients-lock">
+      <mirror sync="false"/>
+   </amqp-connection>
+</broker-connections>
+```
+
+**server2/broker.xml:**
+```xml
+<broker-connections>
+   <amqp-connection uri="tcp://localhost:61000" name="mirrorA" 
retry-interval="2000" lock-coordinator="clients-lock">
+      <mirror sync="false"/>
+   </amqp-connection>
+   <amqp-connection uri="tcp://localhost:61001" name="mirrorB" 
retry-interval="2000" lock-coordinator="clients-lock">
+      <mirror sync="false"/>
+   </amqp-connection>
+</broker-connections>
+```
+
+This ensures that messages, queues, and other operations are replicated across 
all three brokers in a star topology.
+
+### Lock Coordinator for HA
+
+The key feature of this example is the use of **distributed locks** to control 
which broker accepts client connections. All three brokers are configured with 
a lock coordinator on their client acceptors:
+
+```xml
+<lock-coordinators>
+   <lock-coordinator name="clients-lock">
+      
<class-name>org.apache.activemq.artemis.lockmanager.file.FileBasedLockManager</class-name>
+      <lock-id>star-mirror-cluster-clients</lock-id>
+      <check-period>1000</check-period>
+      <properties>
+         <property key="locks-folder" value="/path/to/shared/locks"/>
+      </properties>
+   </lock-coordinator>
+</lock-coordinators>
+
+<acceptors>
+   <acceptor name="forClients" 
lock-coordinator="clients-lock">tcp://localhost:61616</acceptor>
+</acceptors>
+```
+
+The lock coordinator ensures that:
+- Only the broker holding the lock accepts client connections on that acceptor
+- Only the broker holding the lock actively mirrors to other brokers (because 
of lock-coordinator on broker connections)
+- If the active broker fails, the lock is automatically released and acquired 
by another broker
+- The backup broker immediately starts accepting connections when it acquires 
the lock
+- The shared lock file prevents split-brain scenarios
+
+### Client Failover
+
+Clients connect using a failover URL. In this simplified example, all three 
brokers share the same client port (61616) but only the active one accepts 
connections:
+
+```java
+ConnectionFactory factory = new org.apache.qpid.jms.JmsConnectionFactory(
+   "failover:(amqp://localhost:61616)?failover.maxReconnectAttempts=-1");
+```
+
+When the active broker (holding the lock) fails:
+1. The lock is automatically released
+2. One of the backup brokers acquires the lock and starts accepting connections
+3. The client automatically reconnects to the now-active broker
+4. All messages are available due to star mirroring
+
+## Example Flow
+
+1. All three brokers start with star mirroring configured
+2. One broker (typically server0) acquires the distributed lock and accepts 
client connections
+3. The client connects and sends 30 messages to a queue
+4. Server0 is killed (simulating a failure)
+5. Server1 or Server2 automatically acquires the lock and starts accepting 
connections
+6. The client reconnects to the active broker via failover
+7. All 30 messages are consumed from the active broker (due to mirroring)
+
+## Configuration Notes
+
+The lock coordinator supports different lock types (file-based, ZooKeeper). 
This example uses file-based locks where all brokers must have access to a 
shared filesystem location.
+
+The `check-period` parameter (in milliseconds) controls how frequently the 
lock holder verifies it still owns the lock, affecting how quickly failover 
occurs when a broker crashes.
+
+**Important:** This example demonstrates the star topology with lock 
coordinator on broker connections. Unlike the dual mirror example, the 
lock-coordinator attribute is specified on the broker connections themselves, 
ensuring that mirroring only occurs when a broker holds the lock. This prevents 
multiple brokers from simultaneously trying to mirror to each other when they 
don't have the client lock.
+
+## Change the configuration to ZooKeeper
+
+If you want to try ZooKeeper, you need to change the lock-coordinator 
configuration. The class-name for the Lock Manager and the connect-string must 
be provided on all three servers.
+
+```xml
+<lock-coordinators>
+   <lock-coordinator name="clients-lock">
+      
<class-name>org.apache.activemq.artemis.lockmanager.zookeeper.CuratorDistributedLockManager</class-name>
+      <lock-id>star-mirror-cluster-clients</lock-id>
+      <check-period>1000</check-period>
+
+      <properties>
+         <property key="connect-string" value="localhost:2181"/>
+      </properties>
+   </lock-coordinator>
+</lock-coordinators>
+```
+
+And of course you need to have ZooKeeper running for the broker. You can do 
that with Podman or Docker:
+
+```shell
+# you can replace podman with docker if you prefer, using the same arguments...
+podman run -d --name zookeeper-artemis-test -p 2181:2181 zookeeper:latest
+```
diff --git 
a/examples/features/broker-connection/ha-with-mirroring/src/main/java/org/apache/artemis/jms/example/HAWithMirroringExample.java
 
b/examples/features/broker-connection/ha-with-star-mirror/src/main/java/org/apache/artemis/jms/example/HAWithStarMirrorExample.java
similarity index 77%
rename from 
examples/features/broker-connection/ha-with-mirroring/src/main/java/org/apache/artemis/jms/example/HAWithMirroringExample.java
rename to 
examples/features/broker-connection/ha-with-star-mirror/src/main/java/org/apache/artemis/jms/example/HAWithStarMirrorExample.java
index fb0b8b80..fbaf224a 100644
--- 
a/examples/features/broker-connection/ha-with-mirroring/src/main/java/org/apache/artemis/jms/example/HAWithMirroringExample.java
+++ 
b/examples/features/broker-connection/ha-with-star-mirror/src/main/java/org/apache/artemis/jms/example/HAWithStarMirrorExample.java
@@ -30,14 +30,16 @@ import org.apache.activemq.artemis.util.ServerUtil;
 import org.apache.activemq.artemis.utils.FileUtil;
 
 /**
- * Example of live and replicating backup pair using mirroring and a 
distributed lock from the Lock Coordinator
+ * Example of star topology mirroring with three servers using lock 
coordinator on broker connections
  */
-public class HAWithMirroringExample {
+public class HAWithStarMirrorExample {
 
    private static Process server0;
 
    private static Process server1;
 
+   private static Process server2;
+
    public static void main(final String[] args) throws Exception {
       final int numMessages = 30;
 
@@ -48,14 +50,16 @@ public class HAWithMirroringExample {
 
       try {
 
-         // Start the two servers
-         server0 = ServerUtil.startServer(args[0], 
HAWithMirroringExample.class.getSimpleName() + "-peer0", 0, 0);
+         // Start the three servers
+         server0 = ServerUtil.startServer(args[0], 
HAWithStarMirrorExample.class.getSimpleName() + "-peer0", 0, 0);
+         Thread.sleep(2_000);
+         server1 = ServerUtil.startServer(args[1], 
HAWithStarMirrorExample.class.getSimpleName() + "-peer1", 1, 0);
          Thread.sleep(2_000);
-         server1 = ServerUtil.startServer(args[1], 
HAWithMirroringExample.class.getSimpleName() + "-peer1", 1, 0);
+         server2 = ServerUtil.startServer(args[2], 
HAWithStarMirrorExample.class.getSimpleName() + "-peer2", 2, 0);
 
          // We connect to the broker holding the lock on the distributed lock
          ConnectionFactory factory = new 
org.apache.qpid.jms.JmsConnectionFactory(
-            
"failover:(amqp://localhost:61616,amqp://localhost:61617)?failover.maxReconnectAttempts=-1");
+            
"failover:(amqp://localhost:61616)?failover.maxReconnectAttempts=-1");
 
 
          try (Connection connection = factory.createConnection()) {
@@ -63,7 +67,7 @@ public class HAWithMirroringExample {
             Queue queue = session.createQueue("exampleQueue");
             MessageProducer producer = session.createProducer(queue);
 
-            // Send messages in one of the brokers
+            // Send messages to one of the brokers
             for (int i = 0; i < numMessages; i++) {
                producer.send(session.createTextMessage("hello " + i));
             }
@@ -72,9 +76,10 @@ public class HAWithMirroringExample {
             // kill the server that was probably holding the lock:
             ServerUtil.killServer(server0);
 
+            // wait a bit for failover
+            Thread.sleep(2_000);
 
             // now we consume messages after the broker is killed, the client 
should reconnect to the correct broker
-
             MessageConsumer consumer = session.createConsumer(queue);
             connection.start();
             for (int i = 0; i < numMessages; i++) {
@@ -88,6 +93,7 @@ public class HAWithMirroringExample {
       } finally {
          ServerUtil.killServer(server0);
          ServerUtil.killServer(server1);
+         ServerUtil.killServer(server2);
       }
    }
 
@@ -96,5 +102,6 @@ public class HAWithMirroringExample {
       lockFolder.mkdirs();
       FileUtil.findReplace(new File(args[0] + "/etc/broker.xml"), "CHANGEME", 
lockFolder.getAbsolutePath());
       FileUtil.findReplace(new File(args[1] + "/etc/broker.xml"), "CHANGEME", 
lockFolder.getAbsolutePath());
+      FileUtil.findReplace(new File(args[2] + "/etc/broker.xml"), "CHANGEME", 
lockFolder.getAbsolutePath());
    }
 }
diff --git 
a/examples/features/broker-connection/ha-with-mirroring/src/main/resources/artemis/server0/broker.xml
 
b/examples/features/broker-connection/ha-with-star-mirror/src/main/resources/artemis/server0/broker.xml
similarity index 94%
copy from 
examples/features/broker-connection/ha-with-mirroring/src/main/resources/artemis/server0/broker.xml
copy to 
examples/features/broker-connection/ha-with-star-mirror/src/main/resources/artemis/server0/broker.xml
index 6b505d0d..ba59b885 100644
--- 
a/examples/features/broker-connection/ha-with-mirroring/src/main/resources/artemis/server0/broker.xml
+++ 
b/examples/features/broker-connection/ha-with-star-mirror/src/main/resources/artemis/server0/broker.xml
@@ -47,8 +47,8 @@ under the License.
       <lock-coordinators>
          <lock-coordinator name="clients-lock">
             
<class-name>org.apache.activemq.artemis.lockmanager.file.FileBasedLockManager</class-name>
-            <lock-id>mirror-cluster-clients</lock-id>
-            <check-period>1000</check-period> <!-- how often to check if the 
lock is still valid, in milliseconds -->
+            <lock-id>star-mirror-cluster-clients</lock-id>
+            <check-period>1000</check-period>
 
             <properties>
                <property key="locks-folder" value="CHANGEME"/>
@@ -57,7 +57,10 @@ under the License.
       </lock-coordinators>
 
       <broker-connections>
-         <amqp-connection uri="tcp://localhost:61001" name="mirror" 
retry-interval="2000">
+         <amqp-connection uri="tcp://localhost:61001" name="mirrorB" 
retry-interval="2000" lock-coordinator="clients-lock">
+            <mirror sync="true"/>
+         </amqp-connection>
+         <amqp-connection uri="tcp://localhost:61002" name="mirrorC" 
retry-interval="2000" lock-coordinator="clients-lock">
             <mirror sync="true"/>
          </amqp-connection>
       </broker-connections>
@@ -131,7 +134,6 @@ under the License.
          </address>
          <address name="exampleQueue">
             <anycast>
-               <!-- this should be maxed from the default -->
                <queue name="exampleQueue">
                </queue>
             </anycast>
diff --git 
a/examples/features/broker-connection/ha-with-mirroring/src/main/resources/artemis/server1/broker.xml
 
b/examples/features/broker-connection/ha-with-star-mirror/src/main/resources/artemis/server1/broker.xml
similarity index 92%
rename from 
examples/features/broker-connection/ha-with-mirroring/src/main/resources/artemis/server1/broker.xml
rename to 
examples/features/broker-connection/ha-with-star-mirror/src/main/resources/artemis/server1/broker.xml
index 423352ed..c0300938 100644
--- 
a/examples/features/broker-connection/ha-with-mirroring/src/main/resources/artemis/server1/broker.xml
+++ 
b/examples/features/broker-connection/ha-with-star-mirror/src/main/resources/artemis/server1/broker.xml
@@ -40,17 +40,16 @@ under the License.
       <!-- Acceptors -->
       <acceptors>
          <acceptor name="artemis">tcp://localhost:61001</acceptor>
-         <!-- for clients -->
          <!-- this acceptor will serve the clients -->
-         <acceptor name="for-clients" 
lock-coordinator="clients-lock">tcp://localhost:61617</acceptor>
+         <acceptor name="forClients" 
lock-coordinator="clients-lock">tcp://localhost:61616</acceptor>
       </acceptors>
 
 
       <lock-coordinators>
          <lock-coordinator name="clients-lock">
             
<class-name>org.apache.activemq.artemis.lockmanager.file.FileBasedLockManager</class-name>
-            <lock-id>mirror-cluster-clients</lock-id>
-            <check-period>1000</check-period> <!-- how often to check if the 
lock is still valid, in milliseconds -->
+            <lock-id>star-mirror-cluster-clients</lock-id>
+            <check-period>1000</check-period>
 
             <properties>
                <property key="locks-folder" value="CHANGEME"/>
@@ -59,7 +58,10 @@ under the License.
       </lock-coordinators>
 
       <broker-connections>
-         <amqp-connection uri="tcp://localhost:61000" name="mirror" 
retry-interval="2000">
+         <amqp-connection uri="tcp://localhost:61000" name="mirrorA" 
retry-interval="2000" lock-coordinator="clients-lock">
+            <mirror sync="false"/>
+         </amqp-connection>
+         <amqp-connection uri="tcp://localhost:61002" name="mirrorC" 
retry-interval="2000" lock-coordinator="clients-lock">
             <mirror sync="false"/>
          </amqp-connection>
       </broker-connections>
@@ -132,7 +134,6 @@ under the License.
          </address>
          <address name="exampleQueue">
             <anycast>
-               <!-- this should be maxed from the default -->
                <queue name="exampleQueue">
                </queue>
             </anycast>
diff --git 
a/examples/features/broker-connection/ha-with-mirroring/src/main/resources/artemis/server0/broker.xml
 
b/examples/features/broker-connection/ha-with-star-mirror/src/main/resources/artemis/server2/broker.xml
similarity index 92%
rename from 
examples/features/broker-connection/ha-with-mirroring/src/main/resources/artemis/server0/broker.xml
rename to 
examples/features/broker-connection/ha-with-star-mirror/src/main/resources/artemis/server2/broker.xml
index 6b505d0d..c35b17bc 100644
--- 
a/examples/features/broker-connection/ha-with-mirroring/src/main/resources/artemis/server0/broker.xml
+++ 
b/examples/features/broker-connection/ha-with-star-mirror/src/main/resources/artemis/server2/broker.xml
@@ -32,13 +32,14 @@ under the License.
 
       <cluster-password>secret</cluster-password>
 
+      <!-- Connectors -->
       <connectors>
          <connector name="netty-connector">tcp://localhost:61616</connector>
       </connectors>
 
       <!-- Acceptors -->
       <acceptors>
-         <acceptor name="artemis">tcp://localhost:61000</acceptor>
+         <acceptor name="artemis">tcp://localhost:61002</acceptor>
          <!-- this acceptor will serve the clients -->
          <acceptor name="forClients" 
lock-coordinator="clients-lock">tcp://localhost:61616</acceptor>
       </acceptors>
@@ -47,8 +48,8 @@ under the License.
       <lock-coordinators>
          <lock-coordinator name="clients-lock">
             
<class-name>org.apache.activemq.artemis.lockmanager.file.FileBasedLockManager</class-name>
-            <lock-id>mirror-cluster-clients</lock-id>
-            <check-period>1000</check-period> <!-- how often to check if the 
lock is still valid, in milliseconds -->
+            <lock-id>star-mirror-cluster-clients</lock-id>
+            <check-period>1000</check-period>
 
             <properties>
                <property key="locks-folder" value="CHANGEME"/>
@@ -57,12 +58,14 @@ under the License.
       </lock-coordinators>
 
       <broker-connections>
-         <amqp-connection uri="tcp://localhost:61001" name="mirror" 
retry-interval="2000">
-            <mirror sync="true"/>
+         <amqp-connection uri="tcp://localhost:61000" name="mirrorA" 
retry-interval="2000" lock-coordinator="clients-lock">
+            <mirror sync="false"/>
+         </amqp-connection>
+         <amqp-connection uri="tcp://localhost:61001" name="mirrorB" 
retry-interval="2000" lock-coordinator="clients-lock">
+            <mirror sync="false"/>
          </amqp-connection>
       </broker-connections>
 
-
       <security-settings>
          <security-setting match="#">
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -131,11 +134,12 @@ under the License.
          </address>
          <address name="exampleQueue">
             <anycast>
-               <!-- this should be maxed from the default -->
                <queue name="exampleQueue">
                </queue>
             </anycast>
          </address>
       </addresses>
+
+
    </core>
 </configuration>
diff --git a/examples/features/broker-connection/pom.xml 
b/examples/features/broker-connection/pom.xml
index f2606baa..86b3c841 100644
--- a/examples/features/broker-connection/pom.xml
+++ b/examples/features/broker-connection/pom.xml
@@ -62,7 +62,8 @@ under the License.
             <module>amqp-federation-queue-pull-messages</module>
             <module>amqp-bridge</module>
             <module>disaster-recovery</module>
-            <module>ha-with-mirroring</module>
+            <module>ha-with-dual-mirror</module>
+            <module>ha-with-star-mirror</module>
          </modules>
       </profile>
       <profile>
@@ -83,7 +84,8 @@ under the License.
             <module>amqp-federation-queue-pull-messages</module>
             <module>amqp-bridge</module>
             <module>disaster-recovery</module>
-            <module>ha-with-mirroring</module>
+            <module>ha-with-dual-mirror</module>
+            <module>ha-with-star-mirror</module>
          </modules>
       </profile>
    </profiles>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to