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:23 UTC

[2/3] activemq-artemis git commit: ARTEMIS-1793 fix 'destination-type' STOMP header (fix)

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