You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2017/09/14 19:48:13 UTC

svn commit: r1018163 [28/45] - in /websites/production/activemq/content/artemis/docs: 2.2.0/ latest/ latest/diagrams/ latest/gitbook/ latest/gitbook/fonts/ latest/gitbook/fonts/fontawesome/ latest/gitbook/gitbook-plugin-fontsettings/ latest/gitbook/git...

Added: websites/production/activemq/content/artemis/docs/latest/message-grouping.html
==============================================================================
--- websites/production/activemq/content/artemis/docs/latest/message-grouping.html (added)
+++ websites/production/activemq/content/artemis/docs/latest/message-grouping.html Thu Sep 14 19:48:11 2017
@@ -0,0 +1,1219 @@
+
+<!DOCTYPE HTML>
+<html lang="" >
+    <head>
+        <title>Message Grouping · ActiveMQ Artemis Documentation</title>
+        <meta charset="UTF-8">
+        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+        <meta name="description" content="">
+        <meta name="generator" content="GitBook 3.1.1">
+        
+        
+        
+    
+    <link rel="stylesheet" href="gitbook/style.css">
+
+    
+            
+                
+                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
+                
+            
+                
+                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
+                
+            
+                
+                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
+                
+            
+        
+
+    
+
+    
+        
+    
+        
+    
+        
+    
+        
+    
+        
+    
+        
+    
+
+        
+    
+    
+    <meta name="HandheldFriendly" content="true"/>
+    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
+    <meta name="apple-mobile-web-app-capable" content="yes">
+    <meta name="apple-mobile-web-app-status-bar-style" content="black">
+    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
+    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
+
+    
+    <link rel="next" href="pre-acknowledge.html" />
+    
+    
+    <link rel="prev" href="last-value-queues.html" />
+    
+
+    </head>
+    <body>
+        
+<div class="book">
+    <div class="book-summary">
+        
+            
+<div id="book-search-input" role="search">
+    <input type="text" placeholder="Type to search" />
+</div>
+
+            
+                <nav role="navigation">
+                
+
+
+<ul class="summary">
+    
+    
+
+    
+
+    
+        
+        
+    
+        <li class="chapter " data-level="1.1" data-path="./">
+            
+                <a href="./">
+            
+                    
+                    Introduction
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.2" data-path="notice.html">
+            
+                <a href="notice.html">
+            
+                    
+                    Legal Notice
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.3" data-path="preface.html">
+            
+                <a href="preface.html">
+            
+                    
+                    Preface
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.4" data-path="project-info.html">
+            
+                <a href="project-info.html">
+            
+                    
+                    Project Info
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.5" data-path="messaging-concepts.html">
+            
+                <a href="messaging-concepts.html">
+            
+                    
+                    Messaging Concepts
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.6" data-path="architecture.html">
+            
+                <a href="architecture.html">
+            
+                    
+                    Architecture
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.7" data-path="using-server.html">
+            
+                <a href="using-server.html">
+            
+                    
+                    Using the Server
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.8" data-path="address-model.html">
+            
+                <a href="address-model.html">
+            
+                    
+                    Address Model
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.9" data-path="using-jms.html">
+            
+                <a href="using-jms.html">
+            
+                    
+                    Using JMS
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.10" data-path="using-core.html">
+            
+                <a href="using-core.html">
+            
+                    
+                    Using Core
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.11" data-path="using-AMQP.html">
+            
+                <a href="using-AMQP.html">
+            
+                    
+                    Using AMQP
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.12" data-path="jms-core-mapping.html">
+            
+                <a href="jms-core-mapping.html">
+            
+                    
+                    Mapping JMS Concepts to the Core API
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.13" data-path="client-classpath.html">
+            
+                <a href="client-classpath.html">
+            
+                    
+                    The Client Classpath
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.14" data-path="examples.html">
+            
+                <a href="examples.html">
+            
+                    
+                    Examples
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.15" data-path="wildcard-routing.html">
+            
+                <a href="wildcard-routing.html">
+            
+                    
+                    Routing Messages With Wild Cards
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.16" data-path="wildcard-syntax.html">
+            
+                <a href="wildcard-syntax.html">
+            
+                    
+                    Understanding the Apache ActiveMQ Artemis Wildcard Syntax
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.17" data-path="filter-expressions.html">
+            
+                <a href="filter-expressions.html">
+            
+                    
+                    Filter Expressions
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.18" data-path="persistence.html">
+            
+                <a href="persistence.html">
+            
+                    
+                    Persistence
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.19" data-path="configuring-transports.html">
+            
+                <a href="configuring-transports.html">
+            
+                    
+                    Configuring Transports
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.20" data-path="config-reload.html">
+            
+                <a href="config-reload.html">
+            
+                    
+                    Configuration Reload
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.21" data-path="connection-ttl.html">
+            
+                <a href="connection-ttl.html">
+            
+                    
+                    Detecting Dead Connections
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.22" data-path="slow-consumers.html">
+            
+                <a href="slow-consumers.html">
+            
+                    
+                    Detecting Slow Consumers
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.23" data-path="network-isolation.html">
+            
+                <a href="network-isolation.html">
+            
+                    
+                    Avoiding Network Isolation
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.24" data-path="critical-analysis.html">
+            
+                <a href="critical-analysis.html">
+            
+                    
+                    Detecting Broker Issues (Critical Analysis)
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.25" data-path="transaction-config.html">
+            
+                <a href="transaction-config.html">
+            
+                    
+                    Resource Manager Configuration
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.26" data-path="flow-control.html">
+            
+                <a href="flow-control.html">
+            
+                    
+                    Flow Control
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.27" data-path="send-guarantees.html">
+            
+                <a href="send-guarantees.html">
+            
+                    
+                    Guarantees of sends and commits
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.28" data-path="undelivered-messages.html">
+            
+                <a href="undelivered-messages.html">
+            
+                    
+                    Message Redelivery and Undelivered Messages
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.29" data-path="message-expiry.html">
+            
+                <a href="message-expiry.html">
+            
+                    
+                    Message Expiry
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.30" data-path="large-messages.html">
+            
+                <a href="large-messages.html">
+            
+                    
+                    Large Messages
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.31" data-path="paging.html">
+            
+                <a href="paging.html">
+            
+                    
+                    Paging
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.32" data-path="queue-attributes.html">
+            
+                <a href="queue-attributes.html">
+            
+                    
+                    Queue Attributes
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.33" data-path="scheduled-messages.html">
+            
+                <a href="scheduled-messages.html">
+            
+                    
+                    Scheduled Messages
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.34" data-path="last-value-queues.html">
+            
+                <a href="last-value-queues.html">
+            
+                    
+                    Last-Value Queues
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter active" data-level="1.35" data-path="message-grouping.html">
+            
+                <a href="message-grouping.html">
+            
+                    
+                    Message Grouping
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.36" data-path="pre-acknowledge.html">
+            
+                <a href="pre-acknowledge.html">
+            
+                    
+                    Extra Acknowledge Modes
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.37" data-path="management.html">
+            
+                <a href="management.html">
+            
+                    
+                    Management
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.38" data-path="management-console.html">
+            
+                <a href="management-console.html">
+            
+                    
+                    Management Console
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.39" data-path="security.html">
+            
+                <a href="security.html">
+            
+                    
+                    Security
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.40" data-path="broker-plugins.html">
+            
+                <a href="broker-plugins.html">
+            
+                    
+                    Broker Plugins
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.41" data-path="resource-limits.html">
+            
+                <a href="resource-limits.html">
+            
+                    
+                    Resource Limits
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.42" data-path="jms-bridge.html">
+            
+                <a href="jms-bridge.html">
+            
+                    
+                    The JMS Bridge
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.43" data-path="client-reconnection.html">
+            
+                <a href="client-reconnection.html">
+            
+                    
+                    Client Reconnection and Session Reattachment
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.44" data-path="diverts.html">
+            
+                <a href="diverts.html">
+            
+                    
+                    Diverting and Splitting Message Flows
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.45" data-path="core-bridges.html">
+            
+                <a href="core-bridges.html">
+            
+                    
+                    Core Bridges
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.46" data-path="duplicate-detection.html">
+            
+                <a href="duplicate-detection.html">
+            
+                    
+                    Duplicate Message Detection
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.47" data-path="clusters.html">
+            
+                <a href="clusters.html">
+            
+                    
+                    Clusters
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.48" data-path="ha.html">
+            
+                <a href="ha.html">
+            
+                    
+                    High Availability and Failover
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.49" data-path="graceful-shutdown.html">
+            
+                <a href="graceful-shutdown.html">
+            
+                    
+                    Graceful Server Shutdown
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.50" data-path="libaio.html">
+            
+                <a href="libaio.html">
+            
+                    
+                    Libaio Native Libraries
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.51" data-path="thread-pooling.html">
+            
+                <a href="thread-pooling.html">
+            
+                    
+                    Thread management
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.52" data-path="logging.html">
+            
+                <a href="logging.html">
+            
+                    
+                    Logging
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.53" data-path="rest.html">
+            
+                <a href="rest.html">
+            
+                    
+                    REST Interface
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.54" data-path="embedding-activemq.html">
+            
+                <a href="embedding-activemq.html">
+            
+                    
+                    Embedding Apache ActiveMQ Artemis
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.55" data-path="karaf.html">
+            
+                <a href="karaf.html">
+            
+                    
+                    Apache Karaf
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.56" data-path="spring-integration.html">
+            
+                <a href="spring-integration.html">
+            
+                    
+                    Spring Integration
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.57" data-path="cdi-integration.html">
+            
+                <a href="cdi-integration.html">
+            
+                    
+                    CDI Integration
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.58" data-path="intercepting-operations.html">
+            
+                <a href="intercepting-operations.html">
+            
+                    
+                    Intercepting Operations
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.59" data-path="protocols-interoperability.html">
+            
+                <a href="protocols-interoperability.html">
+            
+                    
+                    Protocols and Interoperability
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.60" data-path="tools.html">
+            
+                <a href="tools.html">
+            
+                    
+                    Tools
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.61" data-path="maven-plugin.html">
+            
+                <a href="maven-plugin.html">
+            
+                    
+                    Maven Plugin
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.62" data-path="unit-testing.html">
+            
+                <a href="unit-testing.html">
+            
+                    
+                    Unit Testing
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.63" data-path="perf-tuning.html">
+            
+                <a href="perf-tuning.html">
+            
+                    
+                    Troubleshooting and Performance Tuning
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.64" data-path="configuration-index.html">
+            
+                <a href="configuration-index.html">
+            
+                    
+                    Configuration Reference
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.65" data-path="updating-artemis.html">
+            
+                <a href="updating-artemis.html">
+            
+                    
+                    Updating Artemis
+            
+                </a>
+            
+
+            
+        </li>
+    
+
+    
+
+    <li class="divider"></li>
+
+    <li>
+        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
+            Published with GitBook
+        </a>
+    </li>
+</ul>
+
+
+                </nav>
+            
+        
+    </div>
+
+    <div class="book-body">
+        
+            <div class="body-inner">
+                
+                    
+
+<div class="book-header" role="navigation">
+    
+
+    <!-- Title -->
+    <h1>
+        <i class="fa fa-circle-o-notch fa-spin"></i>
+        <a href="." >Message Grouping</a>
+    </h1>
+</div>
+
+
+
+
+                    <div class="page-wrapper" tabindex="-1" role="main">
+                        <div class="page-inner">
+                            
+<div id="book-search-results">
+    <div class="search-noresults">
+    
+                                <section class="normal markdown-section">
+                                
+                                <h1 id="message-grouping">Message Grouping</h1>
+<p>Message groups are sets of messages that have the following
+characteristics:</p>
+<ul>
+<li><p>Messages in a message group share the same group id, i.e. they have
+same group identifier property (<code>JMSXGroupID</code> for JMS,
+<code>_AMQ_GROUP_ID</code> for Apache ActiveMQ Artemis Core API).</p>
+</li>
+<li><p>Messages in a message group are always consumed by the same
+consumer, even if there are many consumers on a queue. They pin all
+messages with the same group id to the same consumer. If that
+consumer closes another consumer is chosen and will receive all
+messages with the same group id.</p>
+</li>
+</ul>
+<p>Message groups are useful when you want all messages for a certain value
+of the property to be processed serially by the same consumer.</p>
+<p>An example might be orders for a certain stock. You may want orders for
+any particular stock to be processed serially by the same consumer. To
+do this you can create a pool of consumers (perhaps one for each stock,
+but less will work too), then set the stock name as the value of the
+_AMQ_GROUP_ID property.</p>
+<p>This will ensure that all messages for a particular stock will always be
+processed by the same consumer.</p>
+<blockquote>
+<p><strong>Note</strong></p>
+<p>Grouped messages can impact the concurrent processing of non-grouped
+messages due to the underlying FIFO semantics of a queue. For example,
+if there is a chunk of 100 grouped messages at the head of a queue
+followed by 1,000 non-grouped messages then all the grouped messages
+will need to be sent to the appropriate client (which is consuming
+those grouped messages serially) before any of the non-grouped
+messages can be consumed. The functional impact in this scenario is a
+temporary suspension of concurrent message processing while all the
+grouped messages are processed. This can be a performance bottleneck
+so keep it in mind when determining the size of your message groups,
+and consider whether or not you should isolate your grouped messages
+from your non-grouped messages.</p>
+</blockquote>
+<h2 id="using-core-api">Using Core API</h2>
+<p>The property name used to identify the message group is <code>&quot;_AMQ_GROUP_ID&quot;</code>
+(or the constant <code>MessageImpl.HDR_GROUP_ID</code>). Alternatively, you can set
+<code>autogroup</code> to true on the <code>SessionFactory</code> which will pick a random
+unique id.</p>
+<h2 id="using-jms">Using JMS</h2>
+<p>The property name used to identify the message group is <code>JMSXGroupID</code>.</p>
+<pre><code> // send 2 messages in the same group to ensure the same
+ // consumer will receive both
+ Message message = ...
+ message.setStringProperty(&quot;JMSXGroupID&quot;, &quot;Group-0&quot;);
+ producer.send(message);
+
+ message = ...
+ message.setStringProperty(&quot;JMSXGroupID&quot;, &quot;Group-0&quot;);
+ producer.send(message);
+</code></pre><p>Alternatively, you can set <code>autogroup</code> to true on the
+<code>ActiveMQConnectonFactory</code> which will pick a random unique id. This can
+also be set in the JNDI context environment, e.g. <code>jndi.properties</code>.
+Here&apos;s a simple example using the &quot;ConnectionFactory&quot; connection factory
+which is available in the context by default</p>
+<pre><code>java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
+connectionFactory.myConnectionFactory=tcp://localhost:61616?autoGroup=true
+</code></pre><p>Alternatively you can set the group id via the connection factory. All
+messages sent with producers created via this connection factory will
+set the <code>JMSXGroupID</code> to the specified value on all messages sent. This
+can also be set in the JNDI context environment, e.g. <code>jndi.properties</code>.
+Here&apos;s a simple example using the &quot;ConnectionFactory&quot; connection factory
+which is available in the context by default:</p>
+<pre><code>java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
+connectionFactory.myConnectionFactory=tcp://localhost:61616?roupID=Group-0
+</code></pre><h2 id="example">Example</h2>
+<p>See the [examples](examples.md} chapter for an example which shows how message groups are configured and used with JMS and via a connection factory.</p>
+<h2 id="clustered-grouping">Clustered Grouping</h2>
+<p>Using message groups in a cluster is a bit more complex. This is because
+messages with a particular group id can arrive on any node so each node
+needs to know about which group id&apos;s are bound to which consumer on
+which node. The consumer handling messages for a particular group id may
+be on a different node of the cluster, so each node needs to know this
+information so it can route the message correctly to the node which has
+that consumer.</p>
+<p>To solve this there is the notion of a grouping handler. Each node will
+have its own grouping handler and when a messages is sent with a group
+id assigned, the handlers will decide between them which route the
+message should take.</p>
+<p>There are 2 types of handlers; Local and Remote. Each cluster should
+choose 1 node to have a local grouping handler and all the other nodes
+should have remote handlers- it&apos;s the local handler that actually makes
+the decision as to what route should be used, all the other remote
+handlers converse with this. Here is a sample config for both types of
+handler, this should be configured in the <em>broker.xml</em>
+file.</p>
+<pre><code>&lt;grouping-handler name=&quot;my-grouping-handler&quot;&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;
+
+&lt;grouping-handler name=&quot;my-grouping-handler&quot;&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><p>The <em>address</em> attribute refers to a <a href="#clusters.address">cluster connection and the address
+it uses</a>, refer to the clustering section on how to
+configure clusters. The <em>timeout</em> attribute referees to how long to wait
+for a decision to be made, an exception will be thrown during the send
+if this timeout is reached, this ensures that strict ordering is kept.</p>
+<p>The decision as to where a message should be routed to is initially
+proposed by the node that receives the message. The node will pick a
+suitable route as per the normal clustered routing conditions, i.e.
+round robin available queues, use a local queue first and choose a queue
+that has a consumer. If the proposal is accepted by the grouping
+handlers the node will route messages to this queue from that point on,
+if rejected an alternative route will be offered and the node will again
+route to that queue indefinitely. All other nodes will also route to the
+queue chosen at proposal time. Once the message arrives at the queue
+then normal single server message group semantics take over and the
+message is pinned to a consumer on that queue.</p>
+<p>You may have noticed that there is a single point of failure with the
+single local handler. If this node crashes then no decisions will be
+able to be made. Any messages sent will be not be delivered and an
+exception thrown. To avoid this happening Local Handlers can be
+replicated on another backup node. Simple create your back up node and
+configure it with the same Local handler.</p>
+<h2 id="clustered-grouping-best-practices">Clustered Grouping Best Practices</h2>
+<p>Some best practices should be followed when using clustered grouping:</p>
+<ol>
+<li><p>Make sure your consumers are distributed evenly across the different
+nodes if possible. This is only an issue if you are creating and
+closing consumers regularly. Since messages are always routed to the
+same queue once pinned, removing a consumer from this queue may
+leave it with no consumers meaning the queue will just keep
+receiving the messages. Avoid closing consumers or make sure that
+you always have plenty of consumers, i.e., if you have 3 nodes have
+3 consumers.</p>
+</li>
+<li><p>Use durable queues if possible. If queues are removed once a group
+is bound to it, then it is possible that other nodes may still try
+to route messages to it. This can be avoided by making sure that the
+queue is deleted by the session that is sending the messages. This
+means that when the next message is sent it is sent to the node
+where the queue was deleted meaning a new proposal can successfully
+take place. Alternatively you could just start using a different
+group id.</p>
+</li>
+<li><p>Always make sure that the node that has the Local Grouping Handler
+is replicated. These means that on failover grouping will still
+occur.</p>
+</li>
+<li><p>In case you are using group-timeouts, the remote node should have a
+smaller group-timeout with at least half of the value on the main
+coordinator. This is because this will determine how often the
+last-time-use value should be updated with a round trip for a
+request to the group between the nodes.</p>
+</li>
+</ol>
+<h2 id="clustered-grouping-example">Clustered Grouping Example</h2>
+<p>See the <a href="examples.html">examples</a> chapter for an example of how to configure message groups with a ActiveMQ Artemis Cluster.</p>
+
+                                
+                                </section>
+                            
+    </div>
+    <div class="search-results">
+        <div class="has-results">
+            
+            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
+            <ul class="search-results-list"></ul>
+            
+        </div>
+        <div class="no-results">
+            
+            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
+            
+        </div>
+    </div>
+</div>
+
+                        </div>
+                    </div>
+                
+            </div>
+
+            
+                
+                <a href="last-value-queues.html" class="navigation navigation-prev " aria-label="Previous page: Last-Value Queues">
+                    <i class="fa fa-angle-left"></i>
+                </a>
+                
+                
+                <a href="pre-acknowledge.html" class="navigation navigation-next " aria-label="Next page: Extra Acknowledge Modes">
+                    <i class="fa fa-angle-right"></i>
+                </a>
+                
+            
+        
+    </div>
+
+    <script>
+        var gitbook = gitbook || [];
+        gitbook.push(function() {
+            gitbook.page.hasChanged({"page":{"title":"Message Grouping","level":"1.35","depth":1,"next":{"title":"Extra Acknowledge Modes","level":"1.36","depth":1,"path":"pre-acknowledge.md","ref":"pre-acknowledge.md","articles":[]},"previous":{"title":"Last-Value Queues","level":"1.34","depth":1,"path":"last-value-queues.md","ref":"last-value-queues.md","articles":[]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mob
 i.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"github":"apache/activemq-artemis","theme":"default","githubHost":"https://github.com/","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"ActiveMQ Artemis Documentation","links":{"home":"http://activemq.apache.org/artemis","issues":"https://issues.apache.org/jira/browse/ARTEMIS","contribute":"http://activemq.apache.org/contributing.html"},"gitbook":"3.x.x","description":"ActiveMQ Artemis User Guide and Reference Documentation"},"file":{"path":"message-grouping.md","mtime":"2017-08-02T14:45:43.000Z","type":"markdown"},"gitbook":{"version":"3.1.1","time":"2017-09-14T19:42:32.953Z"},"basePath":".","book":{"language":""}});
+        });
+    </script>
+</div>
+
+        
+    <script src="gitbook/gitbook.js"></script>
+    <script src="gitbook/theme.js"></script>
+    
+        
+        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
+        
+    
+        
+        <script src="gitbook/gitbook-plugin-search/search.js"></script>
+        
+    
+        
+        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
+        
+    
+        
+        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
+        
+    
+        
+        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
+        
+    
+        
+        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
+        
+    
+
+    </body>
+</html>
+

Added: websites/production/activemq/content/artemis/docs/latest/messaging-concepts.html
==============================================================================
--- websites/production/activemq/content/artemis/docs/latest/messaging-concepts.html (added)
+++ websites/production/activemq/content/artemis/docs/latest/messaging-concepts.html Thu Sep 14 19:48:11 2017
@@ -0,0 +1,1296 @@
+
+<!DOCTYPE HTML>
+<html lang="" >
+    <head>
+        <title>Messaging Concepts · ActiveMQ Artemis Documentation</title>
+        <meta charset="UTF-8">
+        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+        <meta name="description" content="">
+        <meta name="generator" content="GitBook 3.1.1">
+        
+        
+        
+    
+    <link rel="stylesheet" href="gitbook/style.css">
+
+    
+            
+                
+                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
+                
+            
+                
+                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
+                
+            
+                
+                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
+                
+            
+        
+
+    
+
+    
+        
+    
+        
+    
+        
+    
+        
+    
+        
+    
+        
+    
+
+        
+    
+    
+    <meta name="HandheldFriendly" content="true"/>
+    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
+    <meta name="apple-mobile-web-app-capable" content="yes">
+    <meta name="apple-mobile-web-app-status-bar-style" content="black">
+    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
+    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
+
+    
+    <link rel="next" href="architecture.html" />
+    
+    
+    <link rel="prev" href="project-info.html" />
+    
+
+    </head>
+    <body>
+        
+<div class="book">
+    <div class="book-summary">
+        
+            
+<div id="book-search-input" role="search">
+    <input type="text" placeholder="Type to search" />
+</div>
+
+            
+                <nav role="navigation">
+                
+
+
+<ul class="summary">
+    
+    
+
+    
+
+    
+        
+        
+    
+        <li class="chapter " data-level="1.1" data-path="./">
+            
+                <a href="./">
+            
+                    
+                    Introduction
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.2" data-path="notice.html">
+            
+                <a href="notice.html">
+            
+                    
+                    Legal Notice
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.3" data-path="preface.html">
+            
+                <a href="preface.html">
+            
+                    
+                    Preface
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.4" data-path="project-info.html">
+            
+                <a href="project-info.html">
+            
+                    
+                    Project Info
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter active" data-level="1.5" data-path="messaging-concepts.html">
+            
+                <a href="messaging-concepts.html">
+            
+                    
+                    Messaging Concepts
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.6" data-path="architecture.html">
+            
+                <a href="architecture.html">
+            
+                    
+                    Architecture
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.7" data-path="using-server.html">
+            
+                <a href="using-server.html">
+            
+                    
+                    Using the Server
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.8" data-path="address-model.html">
+            
+                <a href="address-model.html">
+            
+                    
+                    Address Model
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.9" data-path="using-jms.html">
+            
+                <a href="using-jms.html">
+            
+                    
+                    Using JMS
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.10" data-path="using-core.html">
+            
+                <a href="using-core.html">
+            
+                    
+                    Using Core
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.11" data-path="using-AMQP.html">
+            
+                <a href="using-AMQP.html">
+            
+                    
+                    Using AMQP
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.12" data-path="jms-core-mapping.html">
+            
+                <a href="jms-core-mapping.html">
+            
+                    
+                    Mapping JMS Concepts to the Core API
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.13" data-path="client-classpath.html">
+            
+                <a href="client-classpath.html">
+            
+                    
+                    The Client Classpath
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.14" data-path="examples.html">
+            
+                <a href="examples.html">
+            
+                    
+                    Examples
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.15" data-path="wildcard-routing.html">
+            
+                <a href="wildcard-routing.html">
+            
+                    
+                    Routing Messages With Wild Cards
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.16" data-path="wildcard-syntax.html">
+            
+                <a href="wildcard-syntax.html">
+            
+                    
+                    Understanding the Apache ActiveMQ Artemis Wildcard Syntax
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.17" data-path="filter-expressions.html">
+            
+                <a href="filter-expressions.html">
+            
+                    
+                    Filter Expressions
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.18" data-path="persistence.html">
+            
+                <a href="persistence.html">
+            
+                    
+                    Persistence
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.19" data-path="configuring-transports.html">
+            
+                <a href="configuring-transports.html">
+            
+                    
+                    Configuring Transports
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.20" data-path="config-reload.html">
+            
+                <a href="config-reload.html">
+            
+                    
+                    Configuration Reload
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.21" data-path="connection-ttl.html">
+            
+                <a href="connection-ttl.html">
+            
+                    
+                    Detecting Dead Connections
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.22" data-path="slow-consumers.html">
+            
+                <a href="slow-consumers.html">
+            
+                    
+                    Detecting Slow Consumers
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.23" data-path="network-isolation.html">
+            
+                <a href="network-isolation.html">
+            
+                    
+                    Avoiding Network Isolation
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.24" data-path="critical-analysis.html">
+            
+                <a href="critical-analysis.html">
+            
+                    
+                    Detecting Broker Issues (Critical Analysis)
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.25" data-path="transaction-config.html">
+            
+                <a href="transaction-config.html">
+            
+                    
+                    Resource Manager Configuration
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.26" data-path="flow-control.html">
+            
+                <a href="flow-control.html">
+            
+                    
+                    Flow Control
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.27" data-path="send-guarantees.html">
+            
+                <a href="send-guarantees.html">
+            
+                    
+                    Guarantees of sends and commits
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.28" data-path="undelivered-messages.html">
+            
+                <a href="undelivered-messages.html">
+            
+                    
+                    Message Redelivery and Undelivered Messages
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.29" data-path="message-expiry.html">
+            
+                <a href="message-expiry.html">
+            
+                    
+                    Message Expiry
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.30" data-path="large-messages.html">
+            
+                <a href="large-messages.html">
+            
+                    
+                    Large Messages
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.31" data-path="paging.html">
+            
+                <a href="paging.html">
+            
+                    
+                    Paging
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.32" data-path="queue-attributes.html">
+            
+                <a href="queue-attributes.html">
+            
+                    
+                    Queue Attributes
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.33" data-path="scheduled-messages.html">
+            
+                <a href="scheduled-messages.html">
+            
+                    
+                    Scheduled Messages
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.34" data-path="last-value-queues.html">
+            
+                <a href="last-value-queues.html">
+            
+                    
+                    Last-Value Queues
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.35" data-path="message-grouping.html">
+            
+                <a href="message-grouping.html">
+            
+                    
+                    Message Grouping
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.36" data-path="pre-acknowledge.html">
+            
+                <a href="pre-acknowledge.html">
+            
+                    
+                    Extra Acknowledge Modes
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.37" data-path="management.html">
+            
+                <a href="management.html">
+            
+                    
+                    Management
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.38" data-path="management-console.html">
+            
+                <a href="management-console.html">
+            
+                    
+                    Management Console
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.39" data-path="security.html">
+            
+                <a href="security.html">
+            
+                    
+                    Security
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.40" data-path="broker-plugins.html">
+            
+                <a href="broker-plugins.html">
+            
+                    
+                    Broker Plugins
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.41" data-path="resource-limits.html">
+            
+                <a href="resource-limits.html">
+            
+                    
+                    Resource Limits
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.42" data-path="jms-bridge.html">
+            
+                <a href="jms-bridge.html">
+            
+                    
+                    The JMS Bridge
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.43" data-path="client-reconnection.html">
+            
+                <a href="client-reconnection.html">
+            
+                    
+                    Client Reconnection and Session Reattachment
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.44" data-path="diverts.html">
+            
+                <a href="diverts.html">
+            
+                    
+                    Diverting and Splitting Message Flows
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.45" data-path="core-bridges.html">
+            
+                <a href="core-bridges.html">
+            
+                    
+                    Core Bridges
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.46" data-path="duplicate-detection.html">
+            
+                <a href="duplicate-detection.html">
+            
+                    
+                    Duplicate Message Detection
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.47" data-path="clusters.html">
+            
+                <a href="clusters.html">
+            
+                    
+                    Clusters
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.48" data-path="ha.html">
+            
+                <a href="ha.html">
+            
+                    
+                    High Availability and Failover
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.49" data-path="graceful-shutdown.html">
+            
+                <a href="graceful-shutdown.html">
+            
+                    
+                    Graceful Server Shutdown
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.50" data-path="libaio.html">
+            
+                <a href="libaio.html">
+            
+                    
+                    Libaio Native Libraries
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.51" data-path="thread-pooling.html">
+            
+                <a href="thread-pooling.html">
+            
+                    
+                    Thread management
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.52" data-path="logging.html">
+            
+                <a href="logging.html">
+            
+                    
+                    Logging
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.53" data-path="rest.html">
+            
+                <a href="rest.html">
+            
+                    
+                    REST Interface
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.54" data-path="embedding-activemq.html">
+            
+                <a href="embedding-activemq.html">
+            
+                    
+                    Embedding Apache ActiveMQ Artemis
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.55" data-path="karaf.html">
+            
+                <a href="karaf.html">
+            
+                    
+                    Apache Karaf
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.56" data-path="spring-integration.html">
+            
+                <a href="spring-integration.html">
+            
+                    
+                    Spring Integration
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.57" data-path="cdi-integration.html">
+            
+                <a href="cdi-integration.html">
+            
+                    
+                    CDI Integration
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.58" data-path="intercepting-operations.html">
+            
+                <a href="intercepting-operations.html">
+            
+                    
+                    Intercepting Operations
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.59" data-path="protocols-interoperability.html">
+            
+                <a href="protocols-interoperability.html">
+            
+                    
+                    Protocols and Interoperability
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.60" data-path="tools.html">
+            
+                <a href="tools.html">
+            
+                    
+                    Tools
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.61" data-path="maven-plugin.html">
+            
+                <a href="maven-plugin.html">
+            
+                    
+                    Maven Plugin
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.62" data-path="unit-testing.html">
+            
+                <a href="unit-testing.html">
+            
+                    
+                    Unit Testing
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.63" data-path="perf-tuning.html">
+            
+                <a href="perf-tuning.html">
+            
+                    
+                    Troubleshooting and Performance Tuning
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.64" data-path="configuration-index.html">
+            
+                <a href="configuration-index.html">
+            
+                    
+                    Configuration Reference
+            
+                </a>
+            
+
+            
+        </li>
+    
+        <li class="chapter " data-level="1.65" data-path="updating-artemis.html">
+            
+                <a href="updating-artemis.html">
+            
+                    
+                    Updating Artemis
+            
+                </a>
+            
+
+            
+        </li>
+    
+
+    
+
+    <li class="divider"></li>
+
+    <li>
+        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
+            Published with GitBook
+        </a>
+    </li>
+</ul>
+
+
+                </nav>
+            
+        
+    </div>
+
+    <div class="book-body">
+        
+            <div class="body-inner">
+                
+                    
+
+<div class="book-header" role="navigation">
+    
+
+    <!-- Title -->
+    <h1>
+        <i class="fa fa-circle-o-notch fa-spin"></i>
+        <a href="." >Messaging Concepts</a>
+    </h1>
+</div>
+
+
+
+
+                    <div class="page-wrapper" tabindex="-1" role="main">
+                        <div class="page-inner">
+                            
+<div id="book-search-results">
+    <div class="search-noresults">
+    
+                                <section class="normal markdown-section">
+                                
+                                <h1 id="messaging-concepts">Messaging Concepts</h1>
+<p>Apache ActiveMQ Artemis is an asynchronous messaging system, an example of <a href="http://en.wikipedia.org/wiki/Message_oriented_middleware" target="_blank">Message
+Oriented
+Middleware</a> ,
+we&apos;ll just call them messaging systems in the remainder of this book.</p>
+<p>We&apos;ll first present a brief overview of what kind of things messaging
+systems do, where they&apos;re useful and the kind of concepts you&apos;ll hear
+about in the messaging world.</p>
+<p>If you&apos;re already familiar with what a messaging system is and what it&apos;s
+capable of, then you can skip this chapter.</p>
+<h2 id="messaging-concepts">Messaging Concepts</h2>
+<p>Messaging systems allow you to loosely couple heterogeneous systems
+together, whilst typically providing reliability, transactions and many
+other features.</p>
+<p>Unlike systems based on a <a href="http://en.wikipedia.org/wiki/Remote_procedure_call" target="_blank">Remote Procedure
+Call</a> (RPC) pattern,
+messaging systems primarily use an asynchronous message passing pattern
+with no tight relationship between requests and responses. Most
+messaging systems also support a request-response mode but this is not a
+primary feature of messaging systems.</p>
+<p>Designing systems to be asynchronous from end-to-end allows you to
+really take advantage of your hardware resources, minimizing the amount
+of threads blocking on IO operations, and to use your network bandwidth
+to its full capacity. With an RPC approach you have to wait for a
+response for each request you make so are limited by the network round
+trip time, or <em>latency</em> of your network. With an asynchronous system you
+can pipeline flows of messages in different directions, so are limited
+by the network <em>bandwidth</em> not the latency. This typically allows you to
+create much higher performance applications.</p>
+<p>Messaging systems decouple the senders of messages from the consumers of
+messages. The senders and consumers of messages are completely
+independent and know nothing of each other. This allows you to create
+flexible, loosely coupled systems.</p>
+<p>Often, large enterprises use a messaging system to implement a message
+bus which loosely couples heterogeneous systems together. Message buses
+often form the core of an <a href="http://en.wikipedia.org/wiki/Enterprise_service_bus" target="_blank">Enterprise Service
+Bus</a>. (ESB). Using
+a message bus to de-couple disparate systems can allow the system to
+grow and adapt more easily. It also allows more flexibility to add new
+systems or retire old ones since they don&apos;t have brittle dependencies on
+each other.</p>
+<h2 id="messaging-styles">Messaging styles</h2>
+<p>Messaging systems normally support two main styles of asynchronous
+messaging: <a href="http://en.wikipedia.org/wiki/Message_queue" target="_blank">message queue</a>
+messaging (also known as <em>point-to-point messaging</em>) and <a href="http://en.wikipedia.org/wiki/Publish_subscribe" target="_blank">publish
+subscribe</a> messaging.
+We&apos;ll summarise them briefly here:</p>
+<h3 id="the-message-queue-pattern">The Message Queue Pattern</h3>
+<p>With this type of messaging you send a message to a queue. The message
+is then typically persisted to provide a guarantee of delivery, then
+some time later the messaging system delivers the message to a consumer.
+The consumer then processes the message and when it is done, it
+acknowledges the message. Once the message is acknowledged it disappears
+from the queue and is not available to be delivered again. If the system
+crashes before the messaging server receives an acknowledgement from the
+consumer, then on recovery, the message will be available to be
+delivered to a consumer again.</p>
+<p>With point-to-point messaging, there can be many consumers on the queue
+but a particular message will only ever be consumed by a maximum of one
+of them. Senders (also known as <em>producers</em>) to the queue are completely
+decoupled from receivers (also known as <em>consumers</em>) of the queue - they
+do not know of each other&apos;s existence.</p>
+<p>A classic example of point to point messaging would be an order queue in
+a company&apos;s book ordering system. Each order is represented as a message
+which is sent to the order queue. Let&apos;s imagine there are many front end
+ordering systems which send orders to the order queue. When a message
+arrives on the queue it is persisted - this ensures that if the server
+crashes the order is not lost. Let&apos;s also imagine there are many
+consumers on the order queue - each representing an instance of an order
+processing component - these can be on different physical machines but
+consuming from the same queue. The messaging system delivers each
+message to one and only one of the ordering processing components.
+Different messages can be processed by different order processors, but a
+single order is only processed by one order processor - this ensures
+orders aren&apos;t processed twice.</p>
+<p>As an order processor receives a message, it fulfills the order, sends
+order information to the warehouse system and then updates the order
+database with the order details. Once it&apos;s done that it acknowledges the
+message to tell the server that the order has been processed and can be
+forgotten about. Often the send to the warehouse system, update in
+database and acknowledgement will be completed in a single transaction
+to ensure <a href="http://en.wikipedia.org/wiki/ACID" target="_blank">ACID</a> properties.</p>
+<h3 id="the-publish-subscribe-pattern">The Publish-Subscribe Pattern</h3>
+<p>With publish-subscribe messaging many senders can send messages to an
+entity on the server, often called a <em>topic</em> (e.g. in the JMS world).</p>
+<p>There can be many <em>subscriptions</em> on a topic, a subscription is just
+another word for a consumer of a topic. Each subscription receives a
+<em>copy</em> of <em>each</em> message sent to the topic. This differs from the
+message queue pattern where each message is only consumed by a single
+consumer.</p>
+<p>Subscriptions can optionally be <em>durable</em> which means they retain a copy
+of each message sent to the topic until the subscriber consumes them -
+even if the server crashes or is restarted in between. Non-durable
+subscriptions only last a maximum of the lifetime of the connection that
+created them.</p>
+<p>An example of publish-subscribe messaging would be a news feed. As news
+articles are created by different editors around the world they are sent
+to a news feed topic. There are many subscribers around the world who
+are interested in receiving news items - each one creates a subscription
+and the messaging system ensures that a copy of each news message is
+delivered to each subscription.</p>
+<h2 id="delivery-guarantees">Delivery guarantees</h2>
+<p>A key feature of most messaging systems is <em>reliable messaging</em>. With
+reliable messaging the server gives a guarantee that the message will be
+delivered once and only once to each consumer of a queue or each durable
+subscription of a topic, even in the event of system failure. This is
+crucial for many businesses; e.g. you don&apos;t want your orders fulfilled
+more than once or any of your orders to be lost.</p>
+<p>In other cases you may not care about a once and only once delivery
+guarantee and are happy to cope with duplicate deliveries or lost
+messages - an example of this might be transient stock price updates -
+which are quickly superseded by the next update on the same stock. The
+messaging system allows you to configure which delivery guarantees you
+require.</p>
+<h2 id="transactions">Transactions</h2>
+<p>Messaging systems typically support the sending and acknowledgement of
+multiple messages in a single local transaction. Apache ActiveMQ Artemis also supports
+the sending and acknowledgement of message as part of a large global
+transaction - using the Java mapping of XA: JTA.</p>
+<h2 id="durability">Durability</h2>
+<p>Messages are either durable or non durable. Durable messages will be
+persisted in permanent storage and will survive server failure or
+restart. Non durable messages will not survive server failure or
+restart. Examples of durable messages might be orders or trades, where
+they cannot be lost. An example of a non durable message might be a
+stock price update which is transitory and doesn&apos;t need to survive a
+restart.</p>
+<h2 id="messaging-apis-and-protocols">Messaging APIs and protocols</h2>
+<p>How do client applications interact with messaging systems in order to
+send and consume messages?</p>
+<p>Several messaging systems provide their own proprietary APIs with which
+the client communicates with the messaging system.</p>
+<p>There are also some standard ways of operating with messaging systems
+and some emerging standards in this space.</p>
+<p>Let&apos;s take a brief look at these:</p>
+<h3 id="java-message-service-jms">Java Message Service (JMS)</h3>
+<p><a href="http://en.wikipedia.org/wiki/Java_Message_Service" target="_blank">JMS</a> is part of
+Oracle&apos;s Java EE specification. It&apos;s a Java API that encapsulates both message
+queue and publish-subscribe messaging patterns. JMS is a lowest common
+denominator specification - i.e. it was created to encapsulate common
+functionality of the already existing messaging systems that were
+available at the time of its creation.</p>
+<p>JMS is a very popular API and is implemented by most messaging systems.
+JMS is only available to clients running Java.</p>
+<p>JMS does not define a standard wire format - it only defines a
+programmatic API so JMS clients and servers from different vendors
+cannot directly interoperate since each will use the vendor&apos;s own
+internal wire protocol.</p>
+<p>Apache ActiveMQ Artemis provides a fully compliant JMS 1.1 and JMS 2.0 API.</p>
+<h3 id="system-specific-apis">System specific APIs</h3>
+<p>Many systems provide their own programmatic API for which to interact
+with the messaging system. The advantage of this it allows the full set
+of system functionality to be exposed to the client application. API&apos;s
+like JMS are not normally rich enough to expose all the extra features
+that most messaging systems provide.</p>
+<p>Apache ActiveMQ Artemis provides its own core client API for clients to use if they
+wish to have access to functionality over and above that accessible via
+the JMS API.</p>
+<h3 id="restful-api">RESTful API</h3>
+<p><a href="http://en.wikipedia.org/wiki/Representational_State_Transfer" target="_blank">REST</a>
+approaches to messaging are showing a lot interest recently.</p>
+<p>It seems plausible that API standards for cloud computing may converge
+on a REST style set of interfaces and consequently a REST messaging
+approach is a very strong contender for becoming the de-facto method for
+messaging interoperability.</p>
+<p>With a REST approach messaging resources are manipulated as resources
+defined by a URI and typically using a simple set of operations on those
+resources, e.g. PUT, POST, GET etc. REST approaches to messaging often
+use HTTP as their underlying protocol.</p>
+<p>The advantage of a REST approach with HTTP is in its simplicity and the
+fact the internet is already tuned to deal with HTTP optimally.</p>
+<p>Please see <a href="rest.html">Rest Interface</a> for using Apache ActiveMQ Artemis&apos;s RESTful interface.</p>
+<h3 id="amqp">AMQP</h3>
+<p><a href="http://en.wikipedia.org/wiki/AMQP" target="_blank">AMQP</a> is a specification for
+interoperable messaging. It also defines a wire format, so any AMQP
+client can work with any messaging system that supports AMQP. AMQP
+clients are available in many different programming languages.</p>
+<p>Apache ActiveMQ Artemis implements the <a href="https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=amqp" target="_blank">AMQP
+1.0</a>
+specification. Any client that supports the 1.0 specification will be
+able to interact with Apache ActiveMQ Artemis.</p>
+<h3 id="mqtt">MQTT</h3>
+<p><a href="http://mqtt.org/" target="_blank">MQTT</a> is a lightweight connectivity protocol.  It is designed
+to run in environments where device and networks are constrained.  Out of the box
+Apache ActiveMQ Artemis supports version MQTT 3.1.1.  Any client supporting this
+version of the protocol will work against Apache ActiveMQ Artemis.</p>
+<h3 id="stomp">STOMP</h3>
+<p><a href="http://stomp.github.io/" target="_blank">Stomp</a> is a very simple text protocol for
+interoperating with messaging systems. It defines a wire format, so
+theoretically any Stomp client can work with any messaging system that
+supports Stomp. Stomp clients are available in many different
+programming languages.</p>
+<p>Please see <a href="protocols-interoperability.html">Stomp</a> for using STOMP with Apache ActiveMQ Artemis.</p>
+<h3 id="openwire">OPENWIRE</h3>
+<p>ActiveMQ 5.x defines it&apos;s own wire Protocol &quot;OPENWIRE&quot;.  In order to support 
+ActiveMQ 5.x clients, Apache ActiveMQ Artemis supports OPENWIRE.  Any ActiveMQ 5.12.x
+or higher can be used with Apache ActiveMQ Artemis.</p>
+<h2 id="high-availability">High Availability</h2>
+<p>High Availability (HA) means that the system should remain operational
+after failure of one or more of the servers. The degree of support for
+HA varies between various messaging systems.</p>
+<p>Apache ActiveMQ Artemis provides automatic failover where your sessions are
+automatically reconnected to the backup server on event of live server
+failure.</p>
+<p>For more information on HA, please see <a href="ha.html">High Availability and Failover</a>.</p>
+<h2 id="clusters">Clusters</h2>
+<p>Many messaging systems allow you to create groups of messaging servers
+called <em>clusters</em>. Clusters allow the load of sending and consuming
+messages to be spread over many servers. This allows your system to
+scale horizontally by adding new servers to the cluster.</p>
+<p>Degrees of support for clusters varies between messaging systems, with
+some systems having fairly basic clusters with the cluster members being
+hardly aware of each other.</p>
+<p>Apache ActiveMQ Artemis provides very configurable state-of-the-art clustering model
+where messages can be intelligently load balanced between the servers in
+the cluster, according to the number of consumers on each node, and
+whether they are ready for messages.</p>
+<p>Apache ActiveMQ Artemis also has the ability to automatically redistribute messages
+between nodes of a cluster to prevent starvation on any particular node.</p>
+<p>For full details on clustering, please see <a href="clusters.html">Clusters</a>.</p>
+<h2 id="bridges-and-routing">Bridges and routing</h2>
+<p>Some messaging systems allow isolated clusters or single nodes to be
+bridged together, typically over unreliable connections like a wide area
+network (WAN), or the internet.</p>
+<p>A bridge normally consumes from a queue on one server and forwards
+messages to another queue on a different server. Bridges cope with
+unreliable connections, automatically reconnecting when the connections
+becomes available again.</p>
+<p>Apache ActiveMQ Artemis bridges can be configured with filter expressions to only
+forward certain messages, and transformation can also be hooked in.</p>
+<p>Apache ActiveMQ Artemis also allows routing between queues to be configured in server
+side configuration. This allows complex routing networks to be set up
+forwarding or copying messages from one destination to another, forming
+a global network of interconnected brokers.</p>
+<p>For more information please see <a href="core-bridges.html">Core Bridges</a> and <a href="diverts.html">Diverting and Splitting Message Flows</a>.</p>
+
+                                
+                                </section>
+                            
+    </div>
+    <div class="search-results">
+        <div class="has-results">
+            
+            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
+            <ul class="search-results-list"></ul>
+            
+        </div>
+        <div class="no-results">
+            
+            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
+            
+        </div>
+    </div>
+</div>
+
+                        </div>
+                    </div>
+                
+            </div>
+
+            
+                
+                <a href="project-info.html" class="navigation navigation-prev " aria-label="Previous page: Project Info">
+                    <i class="fa fa-angle-left"></i>
+                </a>
+                
+                
+                <a href="architecture.html" class="navigation navigation-next " aria-label="Next page: Architecture">
+                    <i class="fa fa-angle-right"></i>
+                </a>
+                
+            
+        
+    </div>
+
+    <script>
+        var gitbook = gitbook || [];
+        gitbook.push(function() {
+            gitbook.page.hasChanged({"page":{"title":"Messaging Concepts","level":"1.5","depth":1,"next":{"title":"Architecture","level":"1.6","depth":1,"path":"architecture.md","ref":"architecture.md","articles":[]},"previous":{"title":"Project Info","level":"1.4","depth":1,"path":"project-info.md","ref":"project-info.md","articles":[]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css"
 ,"print":"styles/print.css"},"showLevel":false}},"github":"apache/activemq-artemis","theme":"default","githubHost":"https://github.com/","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"ActiveMQ Artemis Documentation","links":{"home":"http://activemq.apache.org/artemis","issues":"https://issues.apache.org/jira/browse/ARTEMIS","contribute":"http://activemq.apache.org/contributing.html"},"gitbook":"3.x.x","description":"ActiveMQ Artemis User Guide and Reference Documentation"},"file":{"path":"messaging-concepts.md","mtime":"2017-09-08T01:26:53.000Z","type":"markdown"},"gitbook":{"version":"3.1.1","time":"2017-09-14T19:42:32.953Z"},"basePath":".","book":{"language":""}});
+        });
+    </script>
+</div>
+
+        
+    <script src="gitbook/gitbook.js"></script>
+    <script src="gitbook/theme.js"></script>
+    
+        
+        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
+        
+    
+        
+        <script src="gitbook/gitbook-plugin-search/search.js"></script>
+        
+    
+        
+        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
+        
+    
+        
+        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
+        
+    
+        
+        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
+        
+    
+        
+        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
+        
+    
+
+    </body>
+</html>
+