activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r360105 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq: ActiveMQConnection.java ActiveMQConnectionFactory.java
Date Fri, 30 Dec 2005 15:34:34 GMT
Author: jstrachan
Date: Fri Dec 30 07:34:31 2005
New Revision: 360105

URL: http://svn.apache.org/viewcvs?rev=360105&view=rev
Log:
allow the RedeliveryPolicy to be configured on an ActiveMQConnectionFactory

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

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java?rev=360105&r1=360104&r2=360105&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
Fri Dec 30 07:34:31 2005
@@ -1217,6 +1217,13 @@
         return redeliveryPolicy;
     }
 
+    /**
+     * Sets the redelivery policy to be used when messages are rolled back
+     */
+    public void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy) {
+        this.redeliveryPolicy = redeliveryPolicy;
+    }
+
     private void waitForBrokerInfo() throws JMSException {
         try {
             brokerInfoReceived.await();

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java?rev=360105&r1=360104&r2=360105&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
Fri Dec 30 07:34:31 2005
@@ -30,6 +30,7 @@
 import javax.jms.TopicConnectionFactory;
 import javax.naming.Context;
 
+import org.apache.activemq.command.RedeliveryPolicy;
 import org.apache.activemq.management.JMSStatsImpl;
 import org.apache.activemq.management.StatsCapable;
 import org.apache.activemq.management.StatsImpl;
@@ -66,6 +67,8 @@
 
     // optimization flags
     private ActiveMQPrefetchPolicy prefetchPolicy = new ActiveMQPrefetchPolicy();
+    private RedeliveryPolicy redeliveryPolicy;
+
     private boolean disableTimeStampsByDefault = false;
     private boolean onSendPrepareMessageBody = true;
     private boolean optimizedMessageDispatch = true;
@@ -207,6 +210,7 @@
             connection.setAsyncDispatch(isAsyncDispatch());
             connection.setUseAsyncSend(isUseAsyncSend());
             connection.setUseRetroactiveConsumer(isUseRetroactiveConsumer());
+            connection.setRedeliveryPolicy(getRedeliveryPolicy());
 
             if( clientID !=null )
                 connection.setClientID(clientID);
@@ -335,6 +339,17 @@
      */
     public void setUseRetroactiveConsumer(boolean useRetroactiveConsumer) {
         this.useRetroactiveConsumer = useRetroactiveConsumer;
+    }
+
+    public RedeliveryPolicy getRedeliveryPolicy() {
+        return redeliveryPolicy;
+    }
+
+    /**
+     * Sets the global redelivery policy to be used when a message is delivered but the session
is rolled back
+     */
+    public void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy) {
+        this.redeliveryPolicy = redeliveryPolicy;
     }
 
     /**



Mime
View raw message