Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 77609200C09 for ; Wed, 25 Jan 2017 18:22:53 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 75EE0160B4E; Wed, 25 Jan 2017 17:22:53 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BDBAA160B3D for ; Wed, 25 Jan 2017 18:22:52 +0100 (CET) Received: (qmail 92399 invoked by uid 500); 25 Jan 2017 17:22:52 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 92390 invoked by uid 99); 25 Jan 2017 17:22:52 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jan 2017 17:22:52 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 618383A0026 for ; Wed, 25 Jan 2017 17:22:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1005587 - in /websites/production/activemq/content: cache/main.pageCache total-ordering.html Date: Wed, 25 Jan 2017 17:22:51 -0000 To: commits@activemq.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170125172251.618383A0026@svn01-us-west.apache.org> archived-at: Wed, 25 Jan 2017 17:22:53 -0000 Author: buildbot Date: Wed Jan 25 17:22:51 2017 New Revision: 1005587 Log: Production update by buildbot for activemq Modified: websites/production/activemq/content/cache/main.pageCache websites/production/activemq/content/total-ordering.html Modified: websites/production/activemq/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/activemq/content/total-ordering.html ============================================================================== --- websites/production/activemq/content/total-ordering.html (original) +++ websites/production/activemq/content/total-ordering.html Wed Jan 25 17:22:51 2017 @@ -81,47 +81,26 @@ -

Sometimes it can be useful to ensure that every topic consumer sees messages arriving on the topic in exactly the same order.

- -

Normally we guarrentee the order of all messages sent by the same producer; however due to multi-threading and asynchronous processing, the messages from different producers could arrive in different consumers in different orders.

- -

e.g. if we have producers P and Q sending messages such that at about the same time P sends P1, P2, P3 and Q sends Q1, Q2. Then 2 different consumeres could see messages arrive in this order...

- -
-
-consumer1: P1 P2 Q1 P3 Q2
+

Sometimes it can be useful to ensure that every topic consumer sees messages arriving on the topic in exactly the same order. Normally the broker will guarantee the order of all messages sent by the same producer. However, owing to the broker's use of multiple threads and asynchronous processing, messages from different producers could arrive in different consumers in different orders.

For example, if we have producers P and Q sending messages such that at about the same time P sends P1, P2P3 and Q sends Q1, Q2. Therefore, two different consumers could see messages arrive in the following order:

+
consumer1: P1 P2 Q1 P3 Q2
 consumer2: P1 Q1 Q2 P2 P3
 
-
- -

i.e. each producers messages are in order; but the streams of messages across producers can get intermixed.

- -

Total ordering of a destination in ActiveMQ ensures that each consumer will see the same total order on that topic. This has a peformance cost, since more synchronization is required, but can be useful - e.g. particularly in times when you want to implement very fast optimistic transactions. With total ordering the messages would arrive like this...

- -
-
-consumer1: P1 P2 Q1 P3 Q2
+

In this example each producer's messages are in self-relative order. However, the streams of messages across producers can get intermixed.

Total Ordering of a destination in ActiveMQ ensures that each consumer will see the same total order on that topic. This has a performance cost, since greater synchronization is required. This can be useful, particularly when very fast optimistic transactions are required. With total ordering the messages would arrive like this:

+
consumer1: P1 P2 Q1 P3 Q2
 consumer2: P1 P2 Q1 P3 Q2
 
-
- -

Configuring Total Ordering

- -

Enable the <strictOrderDispatchPolicy/> on the Per Destination Policies. Here's an example

- -
-
-    <destinationPolicy>
-      <policyMap>
-        <policyEntries>
-          <policyEntry topic=">">
-            <dispatchPolicy>
-              <strictOrderDispatchPolicy />
-            </dispatchPolicy>
-          </policyEntry>
-      </policyEntries></policyMap>
-    </destinationPolicy>
-
+

Configuring Total Ordering

Enable the <strictOrderDispatchPolicy/> on the Per Destination Policies. Here's an example

+
<destinationPolicy>
+  <policyMap>
+    <policyEntries>
+      <policyEntry topic=">">
+        <dispatchPolicy>
+          <strictOrderDispatchPolicy/>
+        </dispatchPolicy>
+      </policyEntry>
+    </policyEntries>
+  </policyMap>
+</destinationPolicy>