activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [50/52] [abbrv] [partial] activemq-artemis git commit: This commit has improvements on the examples including:
Date Wed, 12 Aug 2015 03:47:44 GMT
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/README.md
----------------------------------------------------------------------
diff --git a/examples/README.md b/examples/README.md
new file mode 100644
index 0000000..e9d9e36
--- /dev/null
+++ b/examples/README.md
@@ -0,0 +1,32 @@
+Running the ActiveMQ Artemis Examples
+============================
+
+To run an individual example firstly cd into the example directory and run
+
+```sh
+mvn verify
+```
+
+Most examples offer a way to start them without creating and starting the server (say if you want to do it manually)
+
+```sh
+mvn verify -PnoServer
+```
+
+If you are running against an un released version, i.e. from master branch, you will have to run `mvn install` on the root
+pom.xml and the example/activemq-jms-examples-common/pom.xml first.
+
+If you want to run all the examples (except those that need to be run standalone) you can run `mvn verify -Pexamples` in the examples
+directory but before you do you will need to up the memory used by running:
+
+```
+export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m"
+```
+### Recreating the examples
+
+If you are trying to copy the examples somewhere else and modifying them. Consider asking Maven to explicitly list all the dependencies:
+
+```
+# if trying to modify the 'topic' example:
+cd examples/jms/topic && mvn dependency:list
+```

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/clustered/client-side-load-balancing/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/client-side-load-balancing/pom.xml b/examples/broker-features/clustered/client-side-load-balancing/pom.xml
new file mode 100644
index 0000000..c2993b2
--- /dev/null
+++ b/examples/broker-features/clustered/client-side-load-balancing/pom.xml
@@ -0,0 +1,196 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+   <modelVersion>4.0.0</modelVersion>
+
+   <parent>
+      <groupId>org.apache.activemq.examples.clustered</groupId>
+      <artifactId>broker-clustered</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>client-side-load-balancing</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Client Side Load Balancing Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+   </dependencies>
+
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <clustered>true</clustered>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <clustered>true</clustered>
+                     <portOffset>1</portOffset>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server2</instance>
+                     <clustered>true</clustered>
+                     <portOffset>2</portOffset>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <spawn>true</spawn>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server2</location>
+                     <testURI>tcp://localhost:61618</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server2</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ClientSideLoadBalancingExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server2</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.clustered</groupId>
+                  <artifactId>client-side-load-balancing</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/clustered/client-side-load-balancing/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/client-side-load-balancing/readme.html b/examples/broker-features/clustered/client-side-load-balancing/readme.html
new file mode 100644
index 0000000..9d3aba5
--- /dev/null
+++ b/examples/broker-features/clustered/client-side-load-balancing/readme.html
@@ -0,0 +1,49 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<html>
+  <head>
+    <title>ActiveMQ Artemis JMS Client-Side Load-Balancing Example</title>
+    <link rel="stylesheet" type="text/css" href="../../../common/common.css" />
+    <link rel="stylesheet" type="text/css" href="../../../common/prettify.css" />
+    <script type="text/javascript" src="../../../common/prettify.js"></script>
+  </head>
+  <body onload="prettyPrint()">
+     <h1>JMS Client-Side Load-Balancing Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+     <p>This example demonstrates how connnections created from a single JMS Connection factory can be created
+     to different nodes of the cluster. In other words it demonstrates how ActiveMQ Artemis does <b>client side load balancing</b> of
+     connections across the cluster.</p>
+     <p>The particular load-balancing policy can be chosen to be random, round-robin or user-defined. Please see the user
+     guide for more details of how to configure the specific load-balancing policy. In this example we will use
+     the default round-robin load balancing policy.</p>
+     <p>The list of servers over which ActiveMQ Artemis will round-robin the connections can either be specified explicitly
+     in the connection factory when instantiating it directly, when configuring it on the server or configured
+     to use UDP discovery to discover the list of servers over which to round-robin. This example will use UDP
+     discovery to obtain the list.</p>
+     <p>This example starts three servers which all broadcast their location using UDP discovery. The UDP broadcast configuration
+     can be seen in the <code>broker.xml</code> file.</p>
+     <p>A JMS ConnectionFactory is deployed on each server specifying the discovery group that will be used by that
+     connection factory.</p>
+     <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
+     section of the user manual.</p>
+
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java b/examples/broker-features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java
new file mode 100644
index 0000000..1281017
--- /dev/null
+++ b/examples/broker-features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.jms.example;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+/**
+ * This example demonstrates how sessions created from a single connection can be load
+ * balanced across the different nodes of the cluster.
+ *
+ * In this example there are three nodes and we use a round-robin client side load-balancing
+ * policy.
+ */
+public class ClientSideLoadBalancingExample {
+
+   public static void main(final String[] args) throws Exception {
+      InitialContext initialContext = null;
+
+      Connection connectionA = null;
+      Connection connectionB = null;
+      Connection connectionC = null;
+
+      try {
+         // Step 1. Get an initial context for looking up JNDI from server 0
+         initialContext = new InitialContext();
+
+         // Step 2. Look-up the JMS Queue object from JNDI
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+
+         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
+         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 4. We create 3 JMS connections from the same connection factory. Since we are using round-robin
+         // load-balancing this should result in each sessions being connected to a different node of the cluster
+         Connection conn = connectionFactory.createConnection();
+         // Wait a little while to make sure broadcasts from all nodes have reached the client
+         Thread.sleep(5000);
+         connectionA = connectionFactory.createConnection();
+         connectionB = connectionFactory.createConnection();
+         connectionC = connectionFactory.createConnection();
+         conn.close();
+
+         // Step 5. We create JMS Sessions
+         Session sessionA = connectionA.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         Session sessionB = connectionB.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         Session sessionC = connectionC.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         System.out.println("Session A - " + ((org.apache.activemq.artemis.core.client.impl.DelegatingSession) ((org.apache.activemq.artemis.jms.client.ActiveMQSession) sessionA).getCoreSession()).getConnection().getRemoteAddress());
+         System.out.println("Session B - " + ((org.apache.activemq.artemis.core.client.impl.DelegatingSession) ((org.apache.activemq.artemis.jms.client.ActiveMQSession) sessionB).getCoreSession()).getConnection().getRemoteAddress());
+         System.out.println("Session C - " + ((org.apache.activemq.artemis.core.client.impl.DelegatingSession) ((org.apache.activemq.artemis.jms.client.ActiveMQSession) sessionC).getCoreSession()).getConnection().getRemoteAddress());
+
+         // Step 6. We create JMS MessageProducer objects on the sessions
+         MessageProducer producerA = sessionA.createProducer(queue);
+         MessageProducer producerB = sessionB.createProducer(queue);
+         MessageProducer producerC = sessionC.createProducer(queue);
+
+         // Step 7. We send some messages on each producer
+         final int numMessages = 10;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage messageA = sessionA.createTextMessage("A:This is text message " + i);
+            producerA.send(messageA);
+            System.out.println("Sent message: " + messageA.getText());
+
+            TextMessage messageB = sessionB.createTextMessage("B:This is text message " + i);
+            producerB.send(messageB);
+            System.out.println("Sent message: " + messageB.getText());
+
+            TextMessage messageC = sessionC.createTextMessage("C:This is text message " + i);
+            producerC.send(messageC);
+            System.out.println("Sent message: " + messageC.getText());
+         }
+
+         // Step 8. We start the connection to consume messages
+         connectionA.start();
+         connectionB.start();
+         connectionC.start();
+
+         // Step 9. We consume messages from the 3 session, one at a time.
+         // We try to consume one more message than expected from each session. If
+         // the session were not properly load-balanced, we would be missing a
+         // message from one of the sessions at the end.
+         consume(sessionA, queue, numMessages, "A");
+         consume(sessionB, queue, numMessages, "B");
+         consume(sessionC, queue, numMessages, "C");
+      }
+      finally {
+         // Step 10. Be sure to close our resources!
+
+         if (connectionA != null) {
+            connectionA.close();
+         }
+         if (connectionB != null) {
+            connectionB.close();
+         }
+         if (connectionC != null) {
+            connectionC.close();
+         }
+
+         if (initialContext != null) {
+            initialContext.close();
+         }
+      }
+   }
+
+   private static void consume(Session session, Queue queue, int numMessages, String node) throws JMSException {
+      MessageConsumer consumer = session.createConsumer(queue);
+
+      for (int i = 0; i < numMessages; i++) {
+         TextMessage message = (TextMessage) consumer.receive(2000);
+         System.out.println("Got message: " + message.getText() + " from node " + node);
+      }
+
+      System.out.println("receive other message from node " + node + ": " + consumer.receive(2000));
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/clustered/client-side-load-balancing/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/client-side-load-balancing/src/main/resources/jndi.properties b/examples/broker-features/clustered/client-side-load-balancing/src/main/resources/jndi.properties
new file mode 100644
index 0000000..d3f932c
--- /dev/null
+++ b/examples/broker-features/clustered/client-side-load-balancing/src/main/resources/jndi.properties
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
+connectionFactory.ConnectionFactory=udp://231.7.7.7:9876
+queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/clustered/clustered-durable-subscription/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-durable-subscription/pom.xml b/examples/broker-features/clustered/clustered-durable-subscription/pom.xml
new file mode 100644
index 0000000..8f28710
--- /dev/null
+++ b/examples/broker-features/clustered/clustered-durable-subscription/pom.xml
@@ -0,0 +1,158 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+   <modelVersion>4.0.0</modelVersion>
+
+   <parent>
+      <groupId>org.apache.activemq.examples.clustered</groupId>
+      <artifactId>broker-clustered</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>clustered-durable-subscription</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Clustered Durable Subscription Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+   </dependencies>
+
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <clustered>true</clustered>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <clustered>true</clustered>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                     <portOffset>1</portOffset>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ClusteredDurableSubscriptionExample
+                     </clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.clustered</groupId>
+                  <artifactId>clustered-durable-subscription</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/clustered/clustered-durable-subscription/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-durable-subscription/readme.html b/examples/broker-features/clustered/clustered-durable-subscription/readme.html
new file mode 100644
index 0000000..d50b2b2
--- /dev/null
+++ b/examples/broker-features/clustered/clustered-durable-subscription/readme.html
@@ -0,0 +1,66 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<html>
+  <head>
+    <title>ActiveMQ Artemis JMS Durable Subscription Example</title>
+    <link rel="stylesheet" type="text/css" href="../../../common/common.css" />
+    <link rel="stylesheet" type="text/css" href="../../../common/prettify.css" />
+    <script type="text/javascript" src="../../../common/prettify.js"></script>
+  </head>
+  <body onload="prettyPrint()">
+     <h1>JMS Durable Subscription Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+     <p>This example demonstrates a clustered JMS durable subscription.
+     Normally durable subscriptions exist on a single node and can only have one subscriber at any one time,
+     however, with ActiveMQ Artemis it's possible to create durable subscription instances with the same name and client-id
+     on different nodes of the cluster, and consume from them simultaneously.
+     This allows the work of processing messages from a durable subscription to be spread across the cluster in
+     a similar way to how JMS Queues can be load balanced across the cluster
+     </p>
+     <p>In this example we first configure the two nodes to form a cluster, then we then create a durable subscriber
+     with the same name and client-id on both nodes, and we create a producer on only one of the nodes.</p>
+     <p>We then send some messages via the producer, and we verify that the messages are round robin'd between
+     the two subscription instances. Note that each durable subscription instance with the same name and client-id
+     <b>does not</b> receive its own copy of the messages. This is because the instances on different nodes form a
+     single "logical" durable subscription, in the same way multiple JMS Queue instances on different nodes
+     form a single "local" JMS Queue</p>
+     <p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
+     JNDI, these could be instantiated directly.
+     <p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster between the two nodes
+     and to load balance the messages between the nodes.</p>
+     <p>The cli create method will define this section by default if you use --clustered as a parameter</p>
+     <pre class="prettyprint">
+     <code>&lt;cluster-connection name="my-cluster"&gt;
+        &lt;address&gt;jms&lt;/address&gt;
+        &lt;retry-interval&gt;500&lt;/retry-interval&gt;
+        &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
+        &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
+        &lt;max-hops&gt;1&lt;/max-hops&gt;
+        &lt;discovery-group-ref discovery-group-name="my-discovery-group"/&gt;
+     &lt;/cluster-connection&gt;
+     </code>
+     </pre>
+     <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
+     section of the user manual.</p>
+
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java b/examples/broker-features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
new file mode 100644
index 0000000..6af9577
--- /dev/null
+++ b/examples/broker-features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.jms.example;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * A simple example that shows a JMS Durable Subscription across two nodes of a cluster.
+ *
+ * The same durable subscription can exist on more than one node of the cluster, and messages
+ * sent to the topic will be load-balanced in a round-robin fashion between the two nodes
+ */
+public class ClusteredDurableSubscriptionExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection0 = null;
+
+      Connection connection1 = null;
+
+      try {
+         // Step 1. Instantiate the connection factory on server 0
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
+
+         // Step 2. nstantiate the connection factory on server 1
+         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
+
+         // Step 3. We create a JMS Connection connection0 which is a connection to server 0
+         // and set the client-id
+         connection0 = cf0.createConnection();
+
+         final String clientID = "my-client-id";
+
+         connection0.setClientID(clientID);
+
+         // Step 4. We create a JMS Connection connection1 which is a connection to server 1
+         // and set the same client-id
+         connection1 = cf1.createConnection();
+
+         connection1.setClientID(clientID);
+
+         // Step 5. We create a JMS Session on server 0
+         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 6. We create a JMS Session on server 1
+         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 7. We start the connections to ensure delivery occurs on them
+         connection0.start();
+
+         connection1.start();
+
+         // Step 8. We create JMS durable subscriptions with the same name and client-id on both nodes
+         // of the cluster
+
+         final String subscriptionName = "my-subscription";
+
+         // Step 9. lookup the topic
+         Topic topic = session0.createTopic("exampleTopic");
+
+         MessageConsumer subscriber0 = session0.createDurableSubscriber(topic, subscriptionName);
+
+         MessageConsumer subscriber1 = session1.createDurableSubscriber(topic, subscriptionName);
+
+         Thread.sleep(1000);
+
+         // Step 10. We create a JMS MessageProducer object on server 0
+         MessageProducer producer = session0.createProducer(topic);
+
+         // Step 11. We send some messages to server 0
+
+         final int numMessages = 10;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session0.createTextMessage("This is text message " + i);
+
+            producer.send(message);
+
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 12. We now consume those messages on *both* server 0 and server 1.
+         // Note that the messages have been load-balanced between the two nodes, with some
+         // messages on node 0 and others on node 1.
+         // The "logical" subscription is distributed across the cluster and contains exactly one copy of all the
+         // messages
+
+         for (int i = 0; i < numMessages; i += 2) {
+            TextMessage message0 = (TextMessage) subscriber0.receive(5000);
+
+            System.out.println("Got message: " + message0.getText() + " from node 0");
+
+            TextMessage message1 = (TextMessage) subscriber1.receive(5000);
+
+            System.out.println("Got message: " + message1.getText() + " from node 1");
+         }
+      }
+      finally {
+         // Step 15. Be sure to close our JMS resources!
+         if (connection0 != null) {
+            connection0.close();
+         }
+
+         if (connection1 != null) {
+            connection1.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..2bfaeae
--- /dev/null
+++ b/examples/broker-features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,96 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+               xmlns="urn:activemq"
+               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
+
+   <jms xmlns="urn:activemq:jms">
+      <!--the topic used by the example-->
+      <topic name="exampleTopic"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>./data/bindings</bindings-directory>
+
+      <journal-directory>./data/journal</journal-directory>
+
+      <large-messages-directory>./data/largemessages</large-messages-directory>
+
+      <paging-directory>./data/paging</paging-directory>
+
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61616</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-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="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!--  other configuration -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="jms.topic.exampleTopic">
+            <permission type="createDurableQueue" roles="guest"/>
+            <permission type="deleteDurableQueue" roles="guest"/>
+            <permission type="createNonDurableQueue" roles="guest"/>
+            <permission type="deleteNonDurableQueue" roles="guest"/>
+            <permission type="consume" roles="guest"/>
+            <permission type="send" roles="guest"/>
+         </security-setting>
+      </security-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..8134f27
--- /dev/null
+++ b/examples/broker-features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,96 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+               xmlns="urn:activemq"
+               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
+
+   <jms xmlns="urn:activemq:jms">
+      <!--the topic used by the example-->
+      <topic name="exampleTopic"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>./data/bindings</bindings-directory>
+
+      <journal-directory>./data/journal</journal-directory>
+
+      <large-messages-directory>./data/largemessages</large-messages-directory>
+
+      <paging-directory>./data/paging</paging-directory>
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broacast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-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="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!--  other configuration -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="jms.topic.exampleTopic">
+            <permission type="createDurableQueue" roles="guest"/>
+            <permission type="deleteDurableQueue" roles="guest"/>
+            <permission type="createNonDurableQueue" roles="guest"/>
+            <permission type="deleteNonDurableQueue" roles="guest"/>
+            <permission type="consume" roles="guest"/>
+            <permission type="send" roles="guest"/>
+         </security-setting>
+      </security-settings>
+
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/clustered/clustered-grouping/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-grouping/pom.xml b/examples/broker-features/clustered/clustered-grouping/pom.xml
new file mode 100644
index 0000000..b41a2ad
--- /dev/null
+++ b/examples/broker-features/clustered/clustered-grouping/pom.xml
@@ -0,0 +1,194 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+   <modelVersion>4.0.0</modelVersion>
+
+   <parent>
+      <groupId>org.apache.activemq.examples.clustered</groupId>
+      <artifactId>broker-clustered</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>clustered-grouping</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS CLustered Grouping Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+   </dependencies>
+
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server2</instance>
+                     <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server2</location>
+                     <testURI>tcp://localhost:61618</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server2</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ClusteredGroupingExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server2</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.clustered</groupId>
+                  <artifactId>clustered-grouping</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/clustered/clustered-grouping/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-grouping/readme.html b/examples/broker-features/clustered/clustered-grouping/readme.html
new file mode 100644
index 0000000..7bce8f2
--- /dev/null
+++ b/examples/broker-features/clustered/clustered-grouping/readme.html
@@ -0,0 +1,81 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<html>
+  <head>
+    <title>ActiveMQ Artemis JMS Clustered Grouping Example</title>
+    <link rel="stylesheet" type="text/css" href="../../../common/common.css">
+  </head>
+  <body>
+     <h1>JMS Clustered Grouping Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+     <p>This example demonstrates how to ensure strict ordering across a cluster using clustered message grouping</p>
+     <p>We create 3 nodes each with a grouping message handler, one with a Local handler and 2 with a Remote handler.</p>
+     <p>The local handler acts as an arbitrator for the 2 remote handlers, holding the information on routes and communicating
+         the routing info with the remote handlers on the other 2 nodes</p>
+     <p>We then send some messages to each node with the same group id set and ensure the same consumer receives all of them</p>
+     <p>Here's the relevant snippet from the server configuration that has the local handler</p>
+     <pre>
+     <code>
+       &lt;cluster-connections&gt;
+          &lt;cluster-connection name="my-cluster"&gt;
+             &lt;address&gt;jms&lt;/address&gt;
+             &lt;connector-ref>netty-connector&lt;/connector-ref>
+             &lt;retry-interval&gt;500&lt;/retry-interval&gt;
+             &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
+             &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
+             &lt;max-hops&gt;1&lt;/max-hops&gt;
+             &lt;discovery-group-ref discovery-group-name="my-discovery-group"/&gt;
+          &lt;/cluster-connection&gt;
+       &lt;/cluster-connections&gt;
+
+       &lt;grouping-handler name="my-grouping-handler"&gt;
+          &lt;type&gt;LOCAL&lt;/type&gt;
+          &lt;address&gt;jms&lt;/address&gt;
+          &lt;timeout&gt;5000&lt;/timeout&gt;
+       &lt;/grouping-handler&gt;
+     </code>
+     </pre>
+
+     <p>Here's the relevant snippet from the server configuration that has the remote handlers</p>
+     <pre>
+     <code>
+       &lt;cluster-connections&gt;
+          &lt;cluster-connection name="my-cluster"&gt;
+             &lt;address&gt;jms&lt;/address&gt;
+             &lt;retry-interval&gt;500&lt;/retry-interval&gt;
+             &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
+             &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
+             &lt;max-hops&gt;1&lt;/max-hops&gt;
+             &lt;discovery-group-ref discovery-group-name="my-discovery-group"/&gt;
+          &lt;/cluster-connection&gt;
+       &lt;/cluster-connections&gt;
+
+       &lt;grouping-handler name="my-grouping-handler"&gt;
+          &lt;type&gt;REMOTE&lt;/type&gt;
+          &lt;address&gt;jms&lt;/address&gt;
+          &lt;timeout&gt;5000&lt;/timeout&gt;
+       &lt;/grouping-handler&gt;
+     </code>
+     </pre>
+
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java b/examples/broker-features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
new file mode 100644
index 0000000..dfadef5
--- /dev/null
+++ b/examples/broker-features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.jms.example;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
+ * nodes of the cluster.
+ */
+public class ClusteredGroupingExample {
+
+   public static void main(String[] args) throws Exception {
+      Connection connection0 = null;
+
+      Connection connection1 = null;
+
+      Connection connection2 = null;
+
+      try {
+         // Step 1. We will instantiate the queue object directly on this example
+         //         This could be done through JNDI or JMSession.createQueue
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         // Step 2. create a connection factory towards server 0.
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
+
+         // Step 3. create a connection factory towards server 1.
+         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
+
+         // Step 4.  create a connection factory towards server 2.
+         ConnectionFactory cf2 = new ActiveMQConnectionFactory("tcp://localhost:61618");
+
+         // Step 5. We create a JMS Connection connection0 which is a connection to server 0
+         connection0 = cf0.createConnection();
+
+         // Step 6. We create a JMS Connection connection1 which is a connection to server 1
+         connection1 = cf1.createConnection();
+
+         // Step 7. We create a JMS Connection connection2 which is a connection to server 2
+         connection2 = cf2.createConnection();
+
+         // Step 8. We create a JMS Session on server 0
+         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 9. We create a JMS Session on server 1
+         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 10. We create a JMS Session on server 2
+         Session session2 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 11. We start the connections to ensure delivery occurs on them
+         connection0.start();
+
+         connection1.start();
+
+         connection2.start();
+
+         // Step 12. We create JMS MessageConsumer objects on server 0
+         MessageConsumer consumer = session0.createConsumer(queue);
+
+         // Step 13. We create a JMS MessageProducer object on server 0, 1 and 2
+         MessageProducer producer0 = session0.createProducer(queue);
+
+         MessageProducer producer1 = session1.createProducer(queue);
+
+         MessageProducer producer2 = session2.createProducer(queue);
+
+         // Step 14. We send some messages to server 0, 1 and 2 with the same groupid set
+
+         final int numMessages = 10;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session0.createTextMessage("This is text message " + i);
+
+            message.setStringProperty("JMSXGroupID", "Group-0");
+
+            producer0.send(message);
+
+            System.out.println("Sent messages: " + message.getText() + " to node 0");
+         }
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session1.createTextMessage("This is text message " + (i + 10));
+
+            message.setStringProperty("JMSXGroupID", "Group-0");
+
+            producer1.send(message);
+
+            System.out.println("Sent messages: " + message.getText() + " to node 1");
+
+         }
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session2.createTextMessage("This is text message " + (i + 20));
+
+            message.setStringProperty("JMSXGroupID", "Group-0");
+
+            producer2.send(message);
+
+            System.out.println("Sent messages: " + message.getText() + " to node 2");
+         }
+
+         // Step 15. We now consume those messages from server 0
+         // We note the messages have all been sent to the same consumer on the same node
+
+         for (int i = 0; i < numMessages * 3; i++) {
+            TextMessage message0 = (TextMessage) consumer.receive(5000);
+
+            System.out.println("Got message: " + message0.getText() + " from node 0");
+
+         }
+      }
+      finally {
+         // Step 17. Be sure to close our resources!
+
+         if (connection0 != null) {
+            connection0.close();
+         }
+
+         if (connection1 != null) {
+            connection1.close();
+         }
+
+         if (connection2 != null) {
+            connection2.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..4520059
--- /dev/null
+++ b/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,105 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+               xmlns="urn:activemq"
+               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
+
+   <jms xmlns="urn:activemq:jms">
+      <!--the queue used by the example-->
+      <queue name="exampleQueue"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>./data/bindings</bindings-directory>
+
+      <journal-directory>./data/journal</journal-directory>
+
+      <large-messages-directory>./data/largemessages</large-messages-directory>
+
+      <paging-directory>./data/paging</paging-directory>
+
+
+      <!-- Connectors -->
+
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61616</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-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="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <grouping-handler name="my-grouping-handler">
+         <type>LOCAL</type>
+         <address>jms</address>
+         <timeout>5000</timeout>
+         <group-timeout>-1</group-timeout>
+         <reaper-period>30000</reaper-period>
+      </grouping-handler>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="jms.queue.exampleQueue">
+            <permission type="createDurableQueue" roles="guest"/>
+            <permission type="deleteDurableQueue" roles="guest"/>
+            <permission type="createNonDurableQueue" roles="guest"/>
+            <permission type="deleteNonDurableQueue" roles="guest"/>
+            <permission type="consume" roles="guest"/>
+            <permission type="send" roles="guest"/>
+         </security-setting>
+      </security-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..4765f7a
--- /dev/null
+++ b/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,102 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+               xmlns="urn:activemq"
+               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
+
+   <jms xmlns="urn:activemq:jms">
+      <!--the queue used by the example-->
+      <queue name="exampleQueue"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>./data/bindings</bindings-directory>
+
+      <journal-directory>./data/journal</journal-directory>
+
+      <large-messages-directory>./data/largemessages</large-messages-directory>
+
+      <paging-directory>./data/paging</paging-directory>
+
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-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="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <grouping-handler name="my-grouping-handler">
+         <type>REMOTE</type>
+         <address>jms</address>
+         <timeout>5000</timeout>
+      </grouping-handler>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="jms.queue.exampleQueue">
+            <permission type="createDurableQueue" roles="guest"/>
+            <permission type="deleteDurableQueue" roles="guest"/>
+            <permission type="createNonDurableQueue" roles="guest"/>
+            <permission type="deleteNonDurableQueue" roles="guest"/>
+            <permission type="consume" roles="guest"/>
+            <permission type="send" roles="guest"/>
+         </security-setting>
+      </security-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml b/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml
new file mode 100644
index 0000000..16bf2eb
--- /dev/null
+++ b/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml
@@ -0,0 +1,102 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+               xmlns="urn:activemq"
+               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
+
+   <jms xmlns="urn:activemq:jms">
+      <!--the queue used by the example-->
+      <queue name="exampleQueue"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>./data/bindings</bindings-directory>
+
+      <journal-directory>./data/journal</journal-directory>
+
+      <large-messages-directory>./data/largemessages</large-messages-directory>
+
+      <paging-directory>./data/paging</paging-directory>
+
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61618</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61618</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-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="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <grouping-handler name="my-grouping-handler">
+         <type>REMOTE</type>
+         <address>jms</address>
+         <timeout>5000</timeout>
+      </grouping-handler>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="jms.queue.exampleQueue">
+            <permission type="createDurableQueue" roles="guest"/>
+            <permission type="deleteDurableQueue" roles="guest"/>
+            <permission type="createNonDurableQueue" roles="guest"/>
+            <permission type="deleteNonDurableQueue" roles="guest"/>
+            <permission type="consume" roles="guest"/>
+            <permission type="send" roles="guest"/>
+         </security-setting>
+      </security-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/clustered/clustered-jgroups/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-jgroups/pom.xml b/examples/broker-features/clustered/clustered-jgroups/pom.xml
new file mode 100644
index 0000000..30f6a20
--- /dev/null
+++ b/examples/broker-features/clustered/clustered-jgroups/pom.xml
@@ -0,0 +1,161 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+   <modelVersion>4.0.0</modelVersion>
+
+   <parent>
+      <groupId>org.apache.activemq.examples.clustered</groupId>
+      <artifactId>broker-clustered</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>clustered-jgroups</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Clustered JGroups Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+   </dependencies>
+
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <libList>
+                        <!-- You need to add jgroups.jar to the server's lib -->
+                        <arg>org.jgroups:jgroups:3.6.0.Final</arg>
+                     </libList>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <libList>
+                        <!-- You need to add jgroups.jar to the server's lib -->
+                        <arg>org.jgroups:jgroups:3.6.0.Final</arg>
+                     </libList>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ClusteredJgroupsExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.clustered</groupId>
+                  <artifactId>clustered-jgroups</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>


Mime
View raw message