activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/3] activemq-artemis git commit: ARTEMIS-230 Copy STOMP content-header back and forth
Date Mon, 28 Sep 2015 19:39:58 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 8bb3d1cea -> da17f039a


ARTEMIS-230 Copy STOMP content-header back and forth


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

Branch: refs/heads/master
Commit: 235380d5dffda4858b2fc363792e0998f17f0d46
Parents: 8bb3d1c
Author: Julian Scheid <julians37@gmail.com>
Authored: Fri Sep 25 18:08:57 2015 +0200
Committer: Julian Scheid <julians37@gmail.com>
Committed: Mon Sep 28 14:53:10 2015 +0200

----------------------------------------------------------------------
 .../java/org/apache/activemq/artemis/api/core/Message.java   | 2 ++
 .../activemq/artemis/core/protocol/stomp/StompUtils.java     | 8 ++++++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/235380d5/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 4c2d742..30b8235 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
@@ -71,6 +71,8 @@ public interface Message {
 
    SimpleString HDR_LAST_VALUE_NAME = new SimpleString("_AMQ_LVQ_NAME");
 
+   SimpleString HDR_CONTENT_TYPE = new SimpleString("_AMQ_CONTENT_TYPE");
+
    byte DEFAULT_TYPE = 0;
 
    byte OBJECT_TYPE = 2;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/235380d5/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 e676431..d8468b1 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
@@ -59,6 +59,10 @@ public class StompUtils {
       if (groupID != null) {
          msg.putStringProperty(Message.HDR_GROUP_ID, SimpleString.toSimpleString(groupID));
       }
+      String contentType = headers.remove(Stomp.Headers.CONTENT_TYPE);
+      if (contentType != null) {
+         msg.putStringProperty(Message.HDR_CONTENT_TYPE, SimpleString.toSimpleString(contentType));
+      }
       Object replyTo = headers.remove(Stomp.Headers.Send.REPLY_TO);
       if (replyTo != null) {
          msg.putStringProperty(ClientMessageImpl.REPLYTO_HEADER_NAME, SimpleString.toSimpleString((String)
replyTo));
@@ -96,12 +100,16 @@ public class StompUtils {
       if (message.getObjectProperty("JMSType") != null) {
          command.addHeader(Stomp.Headers.Message.TYPE, message.getObjectProperty("JMSType").toString());
       }
+      if (message.getStringProperty(Message.HDR_CONTENT_TYPE.toString()) != null) {
+         command.addHeader(Stomp.Headers.CONTENT_TYPE, message.getStringProperty(Message.HDR_CONTENT_TYPE.toString()));
+      }
 
       // now let's add all the message headers
       Set<SimpleString> names = message.getPropertyNames();
       for (SimpleString name : names) {
          String value = name.toString();
          if (name.equals(ClientMessageImpl.REPLYTO_HEADER_NAME) ||
+            name.equals(Message.HDR_CONTENT_TYPE) ||
             value.equals("JMSType") ||
             value.equals("JMSCorrelationID") ||
             value.equals(Stomp.Headers.Message.DESTINATION)) {


Mime
View raw message