activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1447766 - in /activemq/activemq-apollo/trunk/apollo-stomp/src: main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala test/scala/org/apache/activemq/apollo/stomp/test/StompTestSupport.scala
Date Tue, 19 Feb 2013 15:32:24 GMT
Author: chirino
Date: Tue Feb 19 15:32:24 2013
New Revision: 1447766

URL: http://svn.apache.org/r1447766
Log:
Delay opening up the subscriptions credit window until after the subscribe receipt is sent
to avoid sending a message before the subscribe receipt is sent.

Modified:
    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/test/StompTestSupport.scala

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=1447766&r1=1447765&r2=1447766&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
Tue Feb 19 15:32:24 2013
@@ -539,7 +539,9 @@ class StompProtocolHandler extends Proto
 
     }, SessionDeliverySizer)
 
-    credit_window_filter.credit(initial_credit_window.count, initial_credit_window.size)
+    def supply_initial_credit = {
+      credit_window_filter.credit(initial_credit_window.count, initial_credit_window.size)
+    }
 
     val session_manager:SessionSinkMux[Delivery] = new SessionSinkMux[Delivery](credit_window_filter,
dispatchQueue, Delivery, initial_credit_window.count.max(1), buffer_size) {
       override def time_stamp = broker.now
@@ -1527,6 +1529,7 @@ class StompProtocolHandler extends Proto
             async_die(reason)
           case None =>
             send_receipt(headers)
+            consumer.supply_initial_credit
         }
       }
     }

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/test/StompTestSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/test/StompTestSupport.scala?rev=1447766&r1=1447765&r2=1447766&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/test/StompTestSupport.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/test/StompTestSupport.scala
Tue Feb 19 15:32:24 2013
@@ -76,7 +76,10 @@ class StompTestSupport extends BrokerFun
     close(c)
   }
 
-  def close(c: StompClient = client) = c.close()
+  def close(c: StompClient = client) = {
+    c.close()
+    clients = clients.filterNot(_ == c)
+  }
 
   val receipt_counter = new AtomicLong()
 



Mime
View raw message