NO-JIRA Diverts: documentation & test updates.

Updated documentation & tests with original destination & message ID info.
Javadoc update & typo fix.
This commit is contained in:
art-licis 2017-12-25 22:17:04 +02:00 committed by Michael Pearce
parent 758cad413e
commit c2a9be9540
3 changed files with 19 additions and 2 deletions

View File

@ -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");

View File

@ -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.

View File

@ -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();
}