activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r553473 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq: ActiveMQConnection.java ActiveMQConnectionFactory.java ActiveMQMessageConsumer.java
Date Thu, 05 Jul 2007 12:21:38 GMT
Author: jstrachan
Date: Thu Jul  5 05:21:37 2007
New Revision: 553473

URL: http://svn.apache.org/viewvc?view=rev&rev=553473
Log:
allow the exclusive queue consumer flag to be defaulted on a connection factory / connection

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
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.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?view=diff&rev=553473&r1=553472&r2=553473
==============================================================================
--- 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
Thu Jul  5 05:21:37 2007
@@ -136,6 +136,7 @@
     private boolean optimizeAcknowledge = false;
     private boolean nestedMapAndListEnabled = true;
     private boolean useRetroactiveConsumer;
+    private boolean exclusiveConsumer;
     private boolean alwaysSyncSend;
     private int closeTimeout = 15000;
     private boolean watchTopicAdvisories=true;
@@ -876,6 +877,20 @@
         this.nestedMapAndListEnabled = structuredMapsEnabled;
     }
 
+    public boolean isExclusiveConsumer() {
+        return exclusiveConsumer;
+    }
+
+    /**
+     * Enables or disables whether or not queue consumers should be exclusive or not
+     * for example to preserve ordering when not using
+     * <a href="http://activemq.apache.org/message-groups.html">Message Groups</a>
+     *
+     * @param exclusiveConsumer
+     */
+    public void setExclusiveConsumer(boolean exclusiveConsumer) {
+        this.exclusiveConsumer = exclusiveConsumer;
+    }
 
     /**
      * Adds a transport listener so that a client can be notified of events in the underlying

@@ -2099,6 +2114,4 @@
     protected void rollbackDuplicate(ActiveMQDispatcher dispatcher,Message message){
        connectionAudit.rollbackDuplicate(dispatcher,message);
     }
-
-
 }

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?view=diff&rev=553473&r1=553472&r2=553473
==============================================================================
--- 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
Thu Jul  5 05:21:37 2007
@@ -17,23 +17,6 @@
  */
 package org.apache.activemq;
 
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Map;
-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.JMSException;
-import javax.jms.QueueConnection;
-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;
@@ -47,6 +30,22 @@
 import org.apache.activemq.util.URISupport;
 import org.apache.activemq.util.URISupport.CompositeData;
 
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.TopicConnection;
+import javax.jms.TopicConnectionFactory;
+import javax.naming.Context;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadFactory;
+
 /**
  * A ConnectionFactory is an an Administered object, and is used for creating
  * Connections. <p/> This class also implements QueueConnectionFactory and
@@ -87,6 +86,7 @@
     private boolean optimizeAcknowledge = false;
     private int closeTimeout = 15000;
     private boolean useRetroactiveConsumer;
+    private boolean exclusiveConsumer;
     private boolean nestedMapAndListEnabled = true;
     JMSStatsImpl factoryStats = new JMSStatsImpl();
     private boolean alwaysSyncSend;
@@ -484,6 +484,21 @@
      */
     public void setUseRetroactiveConsumer(boolean useRetroactiveConsumer) {
         this.useRetroactiveConsumer = useRetroactiveConsumer;
+    }
+
+    public boolean isExclusiveConsumer() {
+        return exclusiveConsumer;
+    }
+
+    /**
+     * Enables or disables whether or not queue consumers should be exclusive or not
+     * for example to preserve ordering when not using
+     * <a href="http://activemq.apache.org/message-groups.html">Message Groups</a>
+     *
+     * @param exclusiveConsumer
+     */
+    public void setExclusiveConsumer(boolean exclusiveConsumer) {
+        this.exclusiveConsumer = exclusiveConsumer;
     }
 
     public RedeliveryPolicy getRedeliveryPolicy() {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java?view=diff&rev=553473&r1=553472&r2=553473
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
Thu Jul  5 05:21:37 2007
@@ -157,6 +157,7 @@
         setTransformer(session.getTransformer());
 
         this.info = new ConsumerInfo(consumerId);
+        this.info.setExclusive(this.session.connection.isExclusiveConsumer());
         this.info.setSubscriptionName(name);
         this.info.setPrefetchSize(prefetch);
         this.info.setCurrentPrefetchSize(prefetch);



Mime
View raw message