activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r366170 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
Date Thu, 05 Jan 2006 12:21:31 GMT
Author: jstrachan
Date: Thu Jan  5 04:21:24 2006
New Revision: 366170

URL: http://svn.apache.org/viewcvs?rev=366170&view=rev
Log:
part of the fix for AMQ-286 to allow the redelivery policy to be configured on a consumer

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

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java?rev=366170&r1=366169&r2=366170&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
Thu Jan  5 04:21:24 2006
@@ -110,6 +110,8 @@
 
     private MessageAvailableListener availableListener;
 
+    private RedeliveryPolicy redeliveryPolicy;
+
     /**
      * Create a MessageConsumer
      * 
@@ -151,6 +153,7 @@
 
         this.session = session;
         this.selector = selector;
+        this.redeliveryPolicy = session.connection.getRedeliveryPolicy();
 
         this.info = new ConsumerInfo(consumerId);
         this.info.setSubcriptionName(name);
@@ -196,6 +199,17 @@
         return stats;
     }
 
+    public RedeliveryPolicy getRedeliveryPolicy() {
+        return redeliveryPolicy;
+    }
+
+    /**
+     * Sets the redelivery policy used when messages are redelivered
+     */
+    public void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy) {
+        this.redeliveryPolicy = redeliveryPolicy;
+    }
+
     /**
      * @return Returns the consumerId.
      */
@@ -637,7 +651,6 @@
                 return;
 
             rollbackCounter++;
-            RedeliveryPolicy redeliveryPolicy = session.connection.getRedeliveryPolicy();
             if (rollbackCounter > redeliveryPolicy.getMaximumRedeliveries()) {
                 
                 // We need to NACK the messages so that they get sent to the



Mime
View raw message