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 2015/07/14 15:55:01 UTC

[1/2] activemq-artemis git commit: Set content-type to STOMP ERROR frames

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 4167c5f2c -> f414c441f


Set content-type to STOMP ERROR frames

Not setting it to directly instantiated 1.0 frames though, as
content-type is not in the 1.0 spec. However the 1.0 spec does not
actually forbid headers outside of the spec so it shouldn't hurt if we
end up setting it for some frames sent over a 1.0 connection.


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

Branch: refs/heads/master
Commit: b38236df82856150a2728b462a62f1fe1957f543
Parents: 4167c5f
Author: Ville Skyttä <vi...@iki.fi>
Authored: Tue Jul 14 11:06:58 2015 +0300
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Jul 14 09:54:40 2015 -0400

----------------------------------------------------------------------
 .../artemis/core/protocol/stomp/ActiveMQStompException.java         | 1 +
 .../apache/activemq/artemis/core/protocol/stomp/StompSession.java   | 1 +
 .../artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java       | 1 +
 3 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b38236df/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompException.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompException.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompException.java
index ba75460..76fcf35 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompException.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompException.java
@@ -91,6 +91,7 @@ public class ActiveMQStompException extends Exception
 
       if (body != null)
       {
+         frame.addHeader(Stomp.Headers.CONTENT_TYPE, "text/plain");
          frame.setByteBody(body.getBytes(StandardCharsets.UTF_8));
       }
       else

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b38236df/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java
index 3541ef0..f7aad8b 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java
@@ -211,6 +211,7 @@ public class StompSession implements SessionCallback
       if (stompSubscription != null)
       {
          StompFrame frame = connection.getFrameHandler().createStompFrame(Stomp.Responses.ERROR);
+         frame.addHeader(Stomp.Headers.CONTENT_TYPE, "text/plain");
          frame.setBody("consumer with ID " + consumerId + " disconnected by server");
          connection.sendFrame(frame);
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b38236df/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java
index d0f5ddf..fa6e2c2 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java
@@ -105,6 +105,7 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
             // not valid
             response = createStompFrame(Stomp.Responses.ERROR);
             response.setNeedsDisconnect(true);
+            response.addHeader(Stomp.Headers.CONTENT_TYPE, "text/plain");
             response.addHeader(Stomp.Headers.Error.MESSAGE, "Failed to connect");
             response.setBody("The login account is not valid.");
          }


[2/2] activemq-artemis git commit: This closes #77 Stomp changes

Posted by cl...@apache.org.
This closes #77 Stomp changes


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

Branch: refs/heads/master
Commit: f414c441f2610c6d4edd793e3b4fdf1aef295153
Parents: 4167c5f b38236d
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Jul 14 09:54:41 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Jul 14 09:54:41 2015 -0400

----------------------------------------------------------------------
 .../artemis/core/protocol/stomp/ActiveMQStompException.java         | 1 +
 .../apache/activemq/artemis/core/protocol/stomp/StompSession.java   | 1 +
 .../artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java       | 1 +
 3 files changed, 3 insertions(+)
----------------------------------------------------------------------