You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2016/03/02 12:45:08 UTC

svn commit: r1733265 - in /qpid/java/trunk: client/src/main/java/org/apache/qpid/client/ doc/jms-client-0-8/src/docbkx/ systests/src/test/java/org/apache/qpid/test/unit/client/temporaryqueue/

Author: rgodfrey
Date: Wed Mar  2 11:45:08 2016
New Revision: 1733265

URL: http://svn.apache.org/viewvc?rev=1733265&view=rev
Log:
QPID-6703 : Address review comments by [~k-wall]

Modified:
    qpid/java/trunk/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java
    qpid/java/trunk/doc/jms-client-0-8/src/docbkx/JMS-Client-Understanding.xml
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java

Modified: qpid/java/trunk/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java?rev=1733265&r1=1733264&r2=1733265&view=diff
==============================================================================
--- qpid/java/trunk/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java (original)
+++ qpid/java/trunk/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java Wed Mar  2 11:45:08 2016
@@ -1379,12 +1379,19 @@ public class AMQSession_0_8 extends AMQS
     protected void deleteTemporaryDestination(final TemporaryDestination amqQueue)
             throws JMSException
     {
-        // Currently TemporaryDestination is set to be auto-delete which, for 0-8..0-9-1, means that the queue will be deleted
-        // by the server when there are no more subscriptions to that queue/topic (rather than when the client disconnects).
-        // This is not quite right for JMSCompliance as the queue/topic should remain until the connection closes, or the
-        // client explicitly deletes it.
+        if(getAMQConnection().getDelegate().isQueueLifetimePolicySupported() && amqQueue instanceof AMQTemporaryQueue)
+        {
+            super.deleteTemporaryDestination(amqQueue);
+        }
+        else
+        {
+            // TemporaryDestination is set to be auto-delete is a topic or queuelifetime policy is not supported.
+            // For 0-8..0-9-1, means that the queue will be deleted by the server when there are no more subscriptions to
+            // that queue/topic (rather than when the client disconnects).  As such the underlying queue may no longer exist
+            // and deleting may throw an error.
 
-        /* intentional no-op */
+            _logger.debug("Delete request for temporary destination {} not implemented"  + amqQueue.getAMQQueueName());
+        }
     }
 
     public boolean isQueueBound(String exchangeName, String queueName,

Modified: qpid/java/trunk/doc/jms-client-0-8/src/docbkx/JMS-Client-Understanding.xml
URL: http://svn.apache.org/viewvc/qpid/java/trunk/doc/jms-client-0-8/src/docbkx/JMS-Client-Understanding.xml?rev=1733265&r1=1733264&r2=1733265&view=diff
==============================================================================
--- qpid/java/trunk/doc/jms-client-0-8/src/docbkx/JMS-Client-Understanding.xml (original)
+++ qpid/java/trunk/doc/jms-client-0-8/src/docbkx/JMS-Client-Understanding.xml Wed Mar  2 11:45:08 2016
@@ -312,20 +312,9 @@ amqp://guest:guest@clientid/?brokerlist=
     </section>
     <section xml:id="JMS-Client-0-8-Client-Understanding-Session-TemporaryQueues">
       <title>TemporaryQueues</title>
-      <para>Qpid implements JMS temporary queues as AMQP auto-delete queues. The life cycle of these
-        queues deviates from the JMS specification.</para>
-      <para>AMQP auto-delete queues are deleted either when the <emphasis>last</emphasis> Consumer
-        closes, or the Connection is closed. If no Consumer is ever attached to the queue, the queue
-        will remain until the Connection is closed.</para>
-      <para>This deviation has no practical impact on the implementation of the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.eaipatterns.com/RequestReply.html">request/reply messaging pattern</link>
-        utilising a per-request temporary reply queue. The reply to queue is deleted as the
-        application closes the Consumer awaiting the response. </para>
       <para>Temporary queues are exposed to Management in the same way as normal queues. Temporary
         queue names take the form string <literal>TempQueue</literal> followed by a random
         UUID.</para>
-      <para>Note that <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${oracleJeeDocUrl}javax/jms/TemporaryQueue.html#delete()">TemporaryQueue#delete()</link> merely marks the queue as deleted on within the JMS
-        client (and prevents further use of the queue from the application), however, the Queue will
-        remain on the Broker until the Consumer (or Connection) is closed.</para>
     </section>
     <section xml:id="JMS-Client-0-8-Client-Understanding-Session-CreateQueue">
       <title>CreateQueue</title>

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java?rev=1733265&r1=1733264&r2=1733265&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java Wed Mar  2 11:45:08 2016
@@ -164,8 +164,6 @@ public class TemporaryQueueTest extends
      * {@link TemporaryQueue#delete()} and is prevented from deleting one that
      * still has consumers.
      *
-     * Note: Under < 0-10 {@link TemporaryQueue#delete()} only marks the queue as deleted
-     * on the client. 0-10 causes the queue to be deleted from the Broker.
      */
     public void testExplictTemporaryQueueDeletion() throws Exception
     {
@@ -205,9 +203,7 @@ public class TemporaryQueueTest extends
             assertEquals("Cannot consume from a deleted destination", je.getMessage());
         }
 
-        if (isBroker010())
-        {
-            assertFalse("Queue should no longer be bound", amqSession.isQueueBound((AMQDestination)queue));
-        }
+        assertFalse("Queue should no longer be bound", amqSession.isQueueBound((AMQDestination)queue));
+
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org