You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by mi...@apache.org on 2018/01/05 12:53:21 UTC

[1/2] activemq-artemis git commit: NO-JIRA Diverts: documentation & test updates.

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 758cad413 -> 719adab1e


NO-JIRA Diverts: documentation & test updates.

Updated documentation & tests with original destination & message ID info.
Javadoc update & typo fix.


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/c2a9be95
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/c2a9be95
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/c2a9be95

Branch: refs/heads/master
Commit: c2a9be9540244d4e5873a4a660e359846ba88c57
Parents: 758cad4
Author: art-licis <ar...@gmail.com>
Authored: Mon Dec 25 22:17:04 2017 +0200
Committer: Michael Pearce <mi...@me.com>
Committed: Fri Jan 5 12:52:44 2018 +0000

----------------------------------------------------------------------
 .../org/apache/activemq/artemis/api/core/Message.java     |  4 ++--
 docs/user-manual/en/diverts.md                            |  7 +++++++
 .../artemis/tests/integration/divert/DivertTest.java      | 10 ++++++++++
 3 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c2a9be95/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java
index 7d29a33..ddb8a3b 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java
@@ -93,7 +93,7 @@ public interface Message {
    SimpleString HDR_ACTUAL_EXPIRY_TIME = new SimpleString("_AMQ_ACTUAL_EXPIRY");
 
    /**
-    * The original address of a message when a message is transferred through DLQ or expiry
+    * The original address of a message when a message is diverted or transferred through DLQ or expiry
     */
    SimpleString HDR_ORIGINAL_ADDRESS = new SimpleString("_AMQ_ORIG_ADDRESS");
 
@@ -103,7 +103,7 @@ public interface Message {
    SimpleString HDR_ORIGINAL_QUEUE = new SimpleString("_AMQ_ORIG_QUEUE");
 
    /**
-    * The original message ID before th emessage was transferred.
+    * The original message ID before the message was transferred.
     */
    SimpleString HDR_ORIG_MESSAGE_ID = new SimpleString("_AMQ_ORIG_MESSAGE_ID");
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c2a9be95/docs/user-manual/en/diverts.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/diverts.md b/docs/user-manual/en/diverts.md
index 86b1b80..4c71b34 100644
--- a/docs/user-manual/en/diverts.md
+++ b/docs/user-manual/en/diverts.md
@@ -44,6 +44,13 @@ geographically distributed servers, creating your global messaging mesh.
 Diverts are defined as xml in the `broker.xml` file at the `core` attribute level.
 There can be zero or more diverts in the file.
 
+Diverted message gets a new message ID, and its address is set to a forward
+address. To access original values, use message properties: original destination
+is stored in a String property `_AMQ_ORIG_ADDRESS` (`Message.HDR_ORIGINAL_ADDRESS`
+constant from the Core API), and the original message ID in a Long property
+`_AMQ_ORIG_MESSAGE_ID` (`Message.HDR_ORIG_MESSAGE_ID` constant from the
+Core API).
+
 Please see the examples for a full working example showing you how to
 configure and use diverts.
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c2a9be95/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/DivertTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/DivertTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/DivertTest.java
index 9f60b30..3d71004 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/DivertTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/DivertTest.java
@@ -104,6 +104,10 @@ public class DivertTest extends ActiveMQTestBase {
 
          Assert.assertEquals(i, message.getObjectProperty(propKey));
 
+         Assert.assertEquals("forwardAddress", message.getAddress());
+
+         Assert.assertEquals("testAddress", message.getStringProperty(Message.HDR_ORIGINAL_ADDRESS));
+
          message.acknowledge();
       }
 
@@ -116,6 +120,8 @@ public class DivertTest extends ActiveMQTestBase {
 
          Assert.assertEquals(i, message.getObjectProperty(propKey));
 
+         Assert.assertEquals("testAddress", message.getAddress());
+
          message.acknowledge();
       }
 
@@ -590,6 +596,10 @@ public class DivertTest extends ActiveMQTestBase {
 
          Assert.assertEquals(i, message.getObjectProperty(propKey));
 
+         Assert.assertEquals("forwardAddress", message.getAddress());
+
+         Assert.assertEquals("testAddress", message.getStringProperty(Message.HDR_ORIGINAL_ADDRESS));
+
          message.acknowledge();
       }
 


[2/2] activemq-artemis git commit: This closes #1741 NO-JIRA Diverts: updated doc

Posted by mi...@apache.org.
This closes #1741 NO-JIRA Diverts: updated doc


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/719adab1
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/719adab1
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/719adab1

Branch: refs/heads/master
Commit: 719adab1ee8be530f07e1fe64277823d8192f28e
Parents: 758cad4 c2a9be9
Author: Michael Pearce <mi...@me.com>
Authored: Fri Jan 5 12:52:45 2018 +0000
Committer: Michael Pearce <mi...@me.com>
Committed: Fri Jan 5 12:52:45 2018 +0000

----------------------------------------------------------------------
 .../org/apache/activemq/artemis/api/core/Message.java     |  4 ++--
 docs/user-manual/en/diverts.md                            |  7 +++++++
 .../artemis/tests/integration/divert/DivertTest.java      | 10 ++++++++++
 3 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------