activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1208476 - in /activemq/activemq-apollo/trunk: apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/ apoll...
Date Wed, 30 Nov 2011 16:02:57 GMT
Author: chirino
Date: Wed Nov 30 16:02:57 2011
New Revision: 1208476

URL: http://svn.apache.org/viewvc?rev=1208476&view=rev
Log:
Follow on work for APLO-92 : The 'auto-delete' header on SUBSCRIBE is no longer needed now
that temp destinations are implemented.  Removing.

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
    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
    activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala?rev=1208476&r1=1208475&r2=1208476&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
Wed Nov 30 16:02:57 2011
@@ -930,14 +930,14 @@ class LocalRouter(val virtual_host:Virtu
   
   def remove_temp_destinations(active_connections:scala.collection.Set[Long]) = {
     virtual_host.dispatch_queue.assertExecuting()
-    val min_create_time = virtual_host.broker.now + 1000;
+    val min_create_time = virtual_host.broker.now - 1000;
 
     // Auto delete temp destinations..
     queue_domain.destinations.filter(x=> is_temp(x.destination_dto)).foreach { queue=>
       val owner = temp_owner(queue.destination_dto).get
       if( owner._1==virtual_host.broker.id // are we the broker that owns the temp destination?
           && !active_connections.contains(owner._2) // Has the connection not around?
-          && queue.service_state.since > min_create_time // It's not a recently
created destination?
+          && queue.service_state.since < min_create_time // It's not a recently
created destination?
       ) {
         _destroy_queue(queue)
       }
@@ -946,7 +946,7 @@ class LocalRouter(val virtual_host:Virtu
       val owner = temp_owner(topic.destination_dto).get
       if( owner._1==virtual_host.broker.id // are we the broker that owns the temp destination?
           && !active_connections.contains(owner._2) // Has the connection not around?
-          && topic.created_at > min_create_time // It's not a recently created
destination?
+          && topic.created_at < min_create_time // It's not a recently created
destination?
       ) {
         topic_domain.destroy_destination(topic.path, topic.destination_dto, null)
       }

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=1208476&r1=1208475&r2=1208476&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 Nov 30 16:02:57 2011
@@ -407,7 +407,6 @@ object Stomp {
   val BROWSER = ascii("browser")
   val EXCLUSIVE = ascii("exclusive")
   val USER_ID = ascii("user-id")
-  val AUTO_DELETE = ascii("auto-delete")
   val TEMP = ascii("temp")
 
   ///////////////////////////////////////////////////////////////////

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=1208476&r1=1208475&r2=1208476&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 Nov 30 16:02:57 2011
@@ -137,7 +137,6 @@ class StompProtocolHandler extends Proto
     val selector:(String, BooleanExpression),
     override val browser:Boolean,
     override val exclusive:Boolean,
-    val auto_delete:Boolean,
     val initial_credit_window:(Int,Int, Boolean)
   ) extends BaseRetained with DeliveryConsumer {
 
@@ -422,17 +421,6 @@ class StompProtocolHandler extends Proto
 
       def dispose = {
         session_manager.close(downstream)
-        if( auto_delete ) {
-          reset {
-            val rc = host.router.delete(destination, security_context)
-            rc match {
-              case Some(error) =>
-                async_die(error)
-              case None =>
-                unit
-            }
-          }
-        }
         release
       }
 
@@ -1060,7 +1048,6 @@ class StompProtocolHandler extends Proto
     var persistent = get(headers, PERSISTENT).map( _ == TRUE ).getOrElse(false)
     var browser = get(headers, BROWSER).map( _ == TRUE ).getOrElse(false)
     var exclusive = get(headers, EXCLUSIVE).map( _ == TRUE ).getOrElse(false)
-    var auto_delete = get(headers, AUTO_DELETE).map( _ == TRUE ).getOrElse(false)
 
     val ack_mode = get(headers, ACK_MODE).getOrElse(ACK_MODE_AUTO)
     val credit_window = get(headers, CREDIT) match {
@@ -1078,16 +1065,6 @@ class StompProtocolHandler extends Proto
         (codec.write_buffer_size, 1, true)
     }
 
-    if(auto_delete) {
-      if( destination.length != 1 ) {
-        die("The auto-delete subscription header cannot be used in conjunction with composite
destinations");
-      }
-      val path = destination_parser.decode_path(destination.head.path)
-      if( PathParser.containsWildCards(path) ) {
-        die("The auto-delete subscription header cannot be used in conjunction with wildcard
destinations");
-      }
-    }
-
     val selector = get(headers, SELECTOR) match {
       case None=> null
       case Some(x)=> x
@@ -1119,7 +1096,7 @@ class StompProtocolHandler extends Proto
       }
     }
 
-    val consumer = new StompConsumer(subscription_id, destination, ack_mode, selector, browser,
exclusive, auto_delete, credit_window);
+    val consumer = new StompConsumer(subscription_id, destination, ack_mode, selector, browser,
exclusive, credit_window);
     consumers += (id -> consumer)
 
     reset {

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=1208476&r1=1208475&r2=1208476&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 Nov 30 16:02:57 2011
@@ -1600,58 +1600,6 @@ class StompExpirationTest extends StompT
   }
 }
 
-class StompAutoDeleteTest extends StompTestSupport {
-
-  def path_separator = "."
-
-  test("Messages Expire") {
-    connect("1.1")
-
-    def put(msg:String) = {
-      client.write(
-        "SEND\n" +
-        "destination:/queue/autodel\n" +
-        "\n" +
-        "message:"+msg+"\n")
-    }
-
-    put("1")
-
-    Thread.sleep(2000)
-
-    client.write(
-      "SUBSCRIBE\n" +
-      "destination:/queue/autodel\n" +
-      "auto-delete:true\n" +
-      "id:1\n" +
-      "\n")
-
-    def get(dest:String) = {
-      val frame = client.receive()
-      frame should startWith("MESSAGE\n")
-      frame should endWith("\n\nmessage:%s\n".format(dest))
-    }
-    get("1")
-
-    // The queue should still exist..
-    expect(true)(queue_exists("autodel"))
-
-    client.write(
-      "UNSUBSCRIBE\n" +
-      "id:1\n" +
-      "receipt:0\n"+
-      "\n")
-    wait_for_receipt("0")
-
-    Thread.sleep(1000);
-
-    // Now that we unsubscribe, it should not exist any more.
-    expect(false)(queue_exists("autodel"))
-
-  }
-}
-
-
 class StompTempDestinationTest extends StompTestSupport {
 
   def path_separator = "."
@@ -1729,11 +1677,11 @@ class StompTempDestinationTest extends S
 
     // Check that temp queue is deleted once the client disconnects
     put("2")
-    assert(queue_exists(actual_temp_dest_name))
+    expect(true)(queue_exists(actual_temp_dest_name.stripPrefix("/queue/")))
     client.close();
 
-    within(5, SECONDS) {
-      assert(!queue_exists(actual_temp_dest_name))
+    within(10, SECONDS) {
+      expect(false)(queue_exists(actual_temp_dest_name.stripPrefix("/queue/")))
     }
   }
 
@@ -1809,11 +1757,11 @@ class StompTempDestinationTest extends S
 
     // Check that temp queue is deleted once the client disconnects
     put("2")
-    assert(topic_exists(actual_temp_dest_name))
+    expect(true)(topic_exists(actual_temp_dest_name.stripPrefix("/topic/")))
     client.close();
 
-    within(5, SECONDS) {
-      assert(!topic_exists(actual_temp_dest_name))
+    within(10, SECONDS) {
+      expect(false)(topic_exists(actual_temp_dest_name.stripPrefix("/topic/")))
     }
 
 

Modified: activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md?rev=1208476&r1=1208475&r2=1208476&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md (original)
+++ activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md Wed Nov
30 16:02:57 2011
@@ -1391,34 +1391,6 @@ to the `SUBSCRIBE` frame.  Example:
     
     ^@
 
-### Queue Auto Delete on `UNSUBSCRIBE`
-
-When you subscribe to a queue, you can add the `auto-delete:true` header
-to have the queue automatically deleted when the subscription ends. This
-is typically used when implementing the request/reply messaging pattern.
-The requesting client creates a temporary dynamically named queue which it
-will use to receive responses for requests which sends out. Once the
-client unsubscribes or his connection terminates, then the queue is
-automatically deleted.
-
-Example:
-
-    SUBSCRIBE
-    id:mysub
-    destination:/queue/temp.myclientid.1308690148000
-    auto-delete:true
-    exclusive:true
-    
-    ^@
-
-If the client does not have sufficient authority to delete the queue, when
-the subscription ends, then the STOMP connection will be terminated with
-an error message.
-
-The auto-delete feature does not work with composite or wildcard destinations.
-it also does not work with topics or durable subscriptions.
-
-
 ### Temporary Destinations
 
 Temporary destinations are typically used to receive response messages in



Mime
View raw message