activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r954599 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq: ActiveMQConnection.java ActiveMQConnectionFactory.java
Date Mon, 14 Jun 2010 19:21:21 GMT
Author: rajdavies
Date: Mon Jun 14 19:21:21 2010
New Revision: 954599

URL: http://svn.apache.org/viewvc?rev=954599&view=rev
Log:
Fix for https://issues.apache.org/activemq/browse/AMQ-2777

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java?rev=954599&r1=954598&r2=954599&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
Mon Jun 14 19:21:21 2010
@@ -147,6 +147,7 @@ public class ActiveMQConnection implemen
     private long warnAboutUnstartedConnectionTimeout = 500L;
     private int sendTimeout =0;
     private boolean sendAcksAsync=true;
+    private boolean checkForDuplicates = true;
 
     private final Transport transport;
     private final IdGenerator clientIdGenerator;
@@ -2245,7 +2246,7 @@ public class ActiveMQConnection implemen
     }
 
     protected boolean isDuplicate(ActiveMQDispatcher dispatcher, Message message) {
-        return connectionAudit.isDuplicate(dispatcher, message);
+        return checkForDuplicates && connectionAudit.isDuplicate(dispatcher, message);
     }
 
     protected void rollbackDuplicate(ActiveMQDispatcher dispatcher, Message message) {
@@ -2317,4 +2318,18 @@ public class ActiveMQConnection implemen
     protected ThreadPoolExecutor getExecutor() {
         return this.executor;
     }
+
+    /**
+     * @return the checkForDuplicates
+     */
+    public boolean isCheckForDuplicates() {
+        return this.checkForDuplicates;
+    }
+
+    /**
+     * @param checkForDuplicates the checkForDuplicates to set
+     */
+    public void setCheckForDuplicates(boolean checkForDuplicates) {
+        this.checkForDuplicates = checkForDuplicates;
+    }
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java?rev=954599&r1=954598&r2=954599&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
Mon Jun 14 19:21:21 2010
@@ -24,7 +24,6 @@ import java.util.Properties;
 import java.util.concurrent.Executor;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.ThreadFactory;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.ExceptionListener;
@@ -34,7 +33,6 @@ import javax.jms.QueueConnectionFactory;
 import javax.jms.TopicConnection;
 import javax.jms.TopicConnectionFactory;
 import javax.naming.Context;
-
 import org.apache.activemq.blob.BlobTransferPolicy;
 import org.apache.activemq.jndi.JNDIBaseStorable;
 import org.apache.activemq.management.JMSStatsImpl;
@@ -115,6 +113,7 @@ public class ActiveMQConnectionFactory e
     private int auditMaximumProducerNumber = ActiveMQMessageAudit.MAXIMUM_PRODUCER_COUNT;
     private boolean useDedicatedTaskRunner;
     private long consumerFailoverRedeliveryWaitPeriod = 0;
+    private boolean checkForDuplicates = true;
     private ClientInternalExceptionListener clientInternalExceptionListener;
 
     // /////////////////////////////////////////////
@@ -318,6 +317,7 @@ public class ActiveMQConnectionFactory e
         connection.setAuditMaximumProducerNumber(getAuditMaximumProducerNumber());
         connection.setUseDedicatedTaskRunner(isUseDedicatedTaskRunner());
         connection.setConsumerFailoverRedeliveryWaitPeriod(getConsumerFailoverRedeliveryWaitPeriod());
+        connection.setCheckForDuplicates(isCheckForDuplicates());
         if (transportListener != null) {
             connection.addTransportListener(transportListener);
         }
@@ -594,6 +594,7 @@ public class ActiveMQConnectionFactory e
         this.transformer = transformer;
     }
 
+    @Override
     public void buildFromProperties(Properties properties) {
 
         if (properties == null) {
@@ -638,6 +639,7 @@ public class ActiveMQConnectionFactory e
         return rc;
     }
 
+    @Override
     public void populateProperties(Properties props) {
         props.setProperty("dispatchAsync", Boolean.toString(isDispatchAsync()));
 
@@ -682,6 +684,7 @@ public class ActiveMQConnectionFactory e
         props.setProperty("sendAcksAsync",Boolean.toString(isSendAcksAsync()));
         props.setProperty("auditDepth", Integer.toString(getAuditDepth()));
         props.setProperty("auditMaximumProducerNumber", Integer.toString(getAuditMaximumProducerNumber()));
+        props.setProperty("checkForDuplicates", Boolean.toString(isCheckForDuplicates()));
     }
 
     public boolean isUseCompression() {
@@ -945,4 +948,18 @@ public class ActiveMQConnectionFactory e
             ClientInternalExceptionListener clientInternalExceptionListener) {
         this.clientInternalExceptionListener = clientInternalExceptionListener;
     }
+
+    /**
+     * @return the checkForDuplicates
+     */
+    public boolean isCheckForDuplicates() {
+        return this.checkForDuplicates;
+    }
+
+    /**
+     * @param checkForDuplicates the checkForDuplicates to set
+     */
+    public void setCheckForDuplicates(boolean checkForDuplicates) {
+        this.checkForDuplicates = checkForDuplicates;
+    }
 }



Mime
View raw message