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 2018/04/18 16:02:22 UTC
[1/3] activemq-artemis git commit: ARTEMIS-1793 fix
'destination-type' STOMP header (test)
Repository: activemq-artemis
Updated Branches:
refs/heads/master 5ca690b3d -> a8c3e1b5f
ARTEMIS-1793 fix 'destination-type' STOMP header (test)
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/37bc26e5
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/37bc26e5
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/37bc26e5
Branch: refs/heads/master
Commit: 37bc26e5740329f6b99c944535f38de2372ac92e
Parents: 5ca690b
Author: Justin Bertram <jb...@apache.org>
Authored: Wed Apr 18 11:52:20 2018 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Apr 18 11:53:31 2018 -0400
----------------------------------------------------------------------
.../tests/integration/stomp/StompTest.java | 36 ++++++++++++++++++++
1 file changed, 36 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/37bc26e5/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
index 5efc521..cd18d0c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
@@ -705,6 +705,42 @@ public class StompTest extends StompTestBase {
}
@Test
+ public void testAnycastDestinationTypeMessageProperty() throws Exception {
+ conn.connect(defUser, defPass);
+
+ subscribe(conn, null, Stomp.Headers.Subscribe.AckModeValues.AUTO);
+
+ send(conn, getQueuePrefix() + getQueueName(), null, getName(), true, RoutingType.ANYCAST);
+
+ ClientStompFrame frame = conn.receiveFrame(10000);
+ Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand());
+ Assert.assertEquals(getQueuePrefix() + getQueueName(), frame.getHeader(Stomp.Headers.Send.DESTINATION));
+ Assert.assertEquals(RoutingType.ANYCAST.toString(), frame.getHeader(Stomp.Headers.Send.DESTINATION_TYPE));
+ Assert.assertTrue(frame.getHeader(org.apache.activemq.artemis.api.core.Message.HDR_ROUTING_TYPE.toString()) == null);
+ Assert.assertEquals(getName(), frame.getBody());
+
+ conn.disconnect();
+ }
+
+ @Test
+ public void testMulticastDestinationTypeMessageProperty() throws Exception {
+ conn.connect(defUser, defPass);
+
+ subscribeTopic(conn, null, null, null);
+
+ send(conn, getTopicPrefix() + getTopicName(), null, getName(), true, RoutingType.MULTICAST);
+
+ ClientStompFrame frame = conn.receiveFrame(10000);
+ Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand());
+ Assert.assertEquals(getTopicPrefix() + getTopicName(), frame.getHeader(Stomp.Headers.Send.DESTINATION));
+ Assert.assertEquals(RoutingType.MULTICAST.toString(), frame.getHeader(Stomp.Headers.Send.DESTINATION_TYPE));
+ Assert.assertTrue(frame.getHeader(org.apache.activemq.artemis.api.core.Message.HDR_ROUTING_TYPE.toString()) == null);
+ Assert.assertEquals(getName(), frame.getBody());
+
+ conn.disconnect();
+ }
+
+ @Test
public void testSubscribeWithAutoAckAndBytesMessage() throws Exception {
conn.connect(defUser, defPass);
subscribe(conn, null, Stomp.Headers.Subscribe.AckModeValues.AUTO);
[3/3] activemq-artemis git commit: This closes #2004
Posted by cl...@apache.org.
This closes #2004
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/a8c3e1b5
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/a8c3e1b5
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/a8c3e1b5
Branch: refs/heads/master
Commit: a8c3e1b5fec867c6149ddaaa0b41276838fcb2ec
Parents: 5ca690b a72046a
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Apr 18 12:02:15 2018 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Apr 18 12:02:15 2018 -0400
----------------------------------------------------------------------
.../artemis/core/protocol/stomp/StompUtils.java | 5 +++
.../en/protocols-interoperability.md | 6 ++++
.../tests/integration/stomp/StompTest.java | 36 ++++++++++++++++++++
3 files changed, 47 insertions(+)
----------------------------------------------------------------------
[2/3] activemq-artemis git commit: ARTEMIS-1793 fix
'destination-type' STOMP header (fix)
Posted by cl...@apache.org.
ARTEMIS-1793 fix 'destination-type' STOMP header (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/a72046a0
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/a72046a0
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/a72046a0
Branch: refs/heads/master
Commit: a72046a0e32fd47cad988a8d71512927f74c8585
Parents: 37bc26e
Author: Justin Bertram <jb...@apache.org>
Authored: Wed Apr 18 11:52:22 2018 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Apr 18 11:53:54 2018 -0400
----------------------------------------------------------------------
.../activemq/artemis/core/protocol/stomp/StompUtils.java | 5 +++++
docs/user-manual/en/protocols-interoperability.md | 6 ++++++
2 files changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a72046a0/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompUtils.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompUtils.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompUtils.java
index ae6bcb9..29e4217 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompUtils.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompUtils.java
@@ -24,6 +24,7 @@ import java.util.Map.Entry;
import java.util.Set;
import org.apache.activemq.artemis.api.core.Message;
+import org.apache.activemq.artemis.api.core.RoutingType;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.core.client.impl.ClientMessageImpl;
import org.apache.activemq.artemis.reader.MessageUtil;
@@ -123,6 +124,9 @@ public class StompUtils {
if (message.getValidatedUserID() != null) {
command.addHeader(Stomp.Headers.Message.VALIDATED_USER, message.getValidatedUserID());
}
+ if (message.getByteProperty(Message.HDR_ROUTING_TYPE.toString()) != null) {
+ command.addHeader(Stomp.Headers.Send.DESTINATION_TYPE, RoutingType.getType(message.getByteProperty(Message.HDR_ROUTING_TYPE.toString())).toString());
+ }
// now let's add all the rest of the message headers
Set<SimpleString> names = message.getPropertyNames();
@@ -130,6 +134,7 @@ public class StompUtils {
if (name.equals(ClientMessageImpl.REPLYTO_HEADER_NAME) ||
name.equals(Message.HDR_CONTENT_TYPE) ||
name.equals(Message.HDR_VALIDATED_USER) ||
+ name.equals(Message.HDR_ROUTING_TYPE) ||
name.equals(MessageUtil.TYPE_HEADER_NAME) ||
name.equals(MessageUtil.CORRELATIONID_HEADER_NAME) ||
name.toString().equals(Stomp.Headers.Message.DESTINATION)) {
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a72046a0/docs/user-manual/en/protocols-interoperability.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/protocols-interoperability.md b/docs/user-manual/en/protocols-interoperability.md
index 7904e45..3a6a26a 100644
--- a/docs/user-manual/en/protocols-interoperability.md
+++ b/docs/user-manual/en/protocols-interoperability.md
@@ -400,6 +400,12 @@ If no indication of routing type is supplied then anycast semantics are used.
The `destination` header maps to an address of the same name. If the `destination` header
used a prefix then the prefix is stripped.
+#### Receiving
+
+When a client receives a message from the broker the message will have the `destination-type`
+header set to either `MULTICAST` or `ANYCAST` as determined when the message was originally
+sent/routed.
+
#### Subscribing
When a Stomp client subscribes to a destination (using a `SUBSCRIBE` frame), the protocol