qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arnaudsi...@apache.org
Subject svn commit: r673074 - in /incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client: BasicMessageConsumer.java BasicMessageConsumer_0_10.java
Date Tue, 01 Jul 2008 13:00:08 GMT
Author: arnaudsimon
Date: Tue Jul  1 06:00:08 2008
New Revision: 673074

URL: http://svn.apache.org/viewvc?rev=673074&view=rev
Log:
QPID-1163: Moved message ack in pre-deliver method

Modified:
    incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
    incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java

Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java?rev=673074&r1=673073&r2=673074&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
Tue Jul  1 06:00:08 2008
@@ -290,6 +290,7 @@
         }
         
         _session.setInRecovery(false);
+        preDeliver(jmsMsg);
     }
 
     /**
@@ -686,7 +687,7 @@
                 // if (!_closed.get())
                 {
 
-                    preDeliver(jmsMessage);
+                    //preDeliver(jmsMessage);
 
                     notifyMessage(jmsMessage);
                 }
@@ -768,6 +769,17 @@
                 // to send out the appropriate frame
                 msg.setAMQSession(_session);
                 break;
+            case Session.SESSION_TRANSACTED:
+                if (isNoConsume())
+                {
+                    _session.acknowledgeMessage(msg.getDeliveryTag(), false);
+                }
+                else
+                {
+                    _session.addDeliveredMessage(msg.getDeliveryTag());
+                }
+
+                break;
         }
     }
 
@@ -794,17 +806,6 @@
                 }
 
                 break;
-            case Session.SESSION_TRANSACTED:
-                if (isNoConsume())
-                {
-                    _session.acknowledgeMessage(msg.getDeliveryTag(), false);
-                }
-                else
-                {
-                    _session.addDeliveredMessage(msg.getDeliveryTag());
-                }
-
-                break;
         }
     }
 

Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java?rev=673074&r1=673073&r2=673074&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java
Tue Jul  1 06:00:08 2008
@@ -261,11 +261,11 @@
 
     @Override protected void preApplicationProcessing(AbstractJMSMessage jmsMsg) throws JMSException
     {
-        if (!_session.getTransacted())
+        super.preApplicationProcessing(jmsMsg);
+        if (!_session.getTransacted() && _session.getAcknowledgeMode() != org.apache.qpid.jms.Session.CLIENT_ACKNOWLEDGE)
         {
             _session.addUnacknowledgedMessage(jmsMsg.getDeliveryTag());
         }
-        _session.setInRecovery(false);
     }
 
     @Override public AbstractJMSMessage createJMSMessageFromUnprocessedMessage(



Mime
View raw message