Author: chirino
Date: Wed Jun 29 12:49:33 2011
New Revision: 1141076
URL: http://svn.apache.org/viewvc?rev=1141076&view=rev
Log:
Fixes https://issues.apache.org/jira/browse/APLO-58: STOMP end of browse message does not
contain two of the mandatory STOMP 1.1 MESSAGE fields: message-id and destination.
Modified:
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompFrame.scala
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala
Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompFrame.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompFrame.scala?rev=1141076&r1=1141075&r2=1141076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompFrame.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompFrame.scala
Wed Jun 29 12:49:33 2011
@@ -422,6 +422,8 @@ object Stomp {
val V1_1 = ascii("1.1")
val DEFAULT_HEART_BEAT = ascii("0,0")
+ val EMPTY = EMPTY_BUFFER.ascii()
+
val SUPPORTED_PROTOCOL_VERSIONS = List(V1_1, V1_0)
val TEXT_PLAIN = ascii("text/plain")
Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala?rev=1141076&r1=1141075&r2=1141076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
Wed Jun 29 12:49:33 2011
@@ -292,7 +292,8 @@ class StompProtocolHandler extends Proto
closed = true
if( browser ) {
// Then send the end of browse message.
- var frame = StompFrame(MESSAGE, (BROWSER, END)::Nil, BufferContent(EMPTY_BUFFER))
+ val headers:HeaderMap = List(DESTINATION->EMPTY, MESSAGE_ID->EMPTY, BROWSER->END)
+ var frame = StompFrame(MESSAGE, headers, BufferContent(EMPTY_BUFFER))
if( subscription_id != None ) {
frame = frame.append_headers((SUBSCRIPTION, subscription_id.get)::Nil)
}
Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala?rev=1141076&r1=1141075&r2=1141076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala
Wed Jun 29 12:49:33 2011
@@ -444,6 +444,8 @@ class StompDestinationTest extends Stomp
frame should startWith("MESSAGE\n")
frame should include ("subscription:0\n")
frame should include ("browser:end\n")
+ frame should include ("\nmessage-id:")
+ frame should include ("\ndestination:")
// create a regular subscription.
client.write(
|