activemq-artemis/examples/features/clustered/clustered-grouping
Martyn Taylor 6408fd0357 [maven-release-plugin] prepare for next development iteration 2015-09-11 19:01:57 +01:00
..
src/main renaming broker-features -> features on examples 2015-08-13 00:11:56 -04:00
pom.xml [maven-release-plugin] prepare for next development iteration 2015-09-11 19:01:57 +01:00
readme.html renaming broker-features -> features on examples 2015-08-13 00:11:56 -04:00

readme.html

<!--
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>