activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1471673 - in /activemq/trunk: activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4472Test.java
Date Wed, 24 Apr 2013 21:01:24 GMT
Author: chirino
Date: Wed Apr 24 21:01:24 2013
New Revision: 1471673

URL: http://svn.apache.org/r1471673
Log:
Fix for AMQ4472: We can eagerly close a txed consumer if it has not delivered any messages.

Modified:
    activemq/trunk/activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4472Test.java

Modified: activemq/trunk/activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java?rev=1471673&r1=1471672&r2=1471673&view=diff
==============================================================================
--- activemq/trunk/activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
(original)
+++ activemq/trunk/activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
Wed Apr 24 21:01:24 2013
@@ -666,7 +666,7 @@ public class ActiveMQMessageConsumer imp
     @Override
     public void close() throws JMSException {
         if (!unconsumedMessages.isClosed()) {
-            if (session.getTransactionContext().isInTransaction()) {
+            if (!deliveredMessages.isEmpty() && session.getTransactionContext().isInTransaction())
{
                 session.getTransactionContext().addSynchronization(new Synchronization()
{
                     @Override
                     public void afterCommit() throws Exception {

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4472Test.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4472Test.java?rev=1471673&r1=1471672&r2=1471673&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4472Test.java
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4472Test.java
Wed Apr 24 21:01:24 2013
@@ -40,7 +40,7 @@ public class AMQ4472Test {
     public void testLostMessage() {
         Connection connection = null;
         try {
-            ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.useJmx=false&jms.prefetchPolicy.all=0");
+            ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.useJmx=false");
             connection = connectionFactory.createConnection();
             connection.start();
 



Mime
View raw message