activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r691214 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker: jmx/QueueView.java region/Queue.java
Date Tue, 02 Sep 2008 12:22:52 GMT
Author: rajdavies
Date: Tue Sep  2 05:22:51 2008
New Revision: 691214

URL: http://svn.apache.org/viewvc?rev=691214&view=rev
Log:
reset redivery counter on retryMessage() - and speed it up a little -
for https://issues.apache.org/activemq/browse/AMQ-1909

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueView.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueView.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueView.java?rev=691214&r1=691213&r2=691214&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueView.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueView.java
Tue Sep  2 05:22:51 2008
@@ -100,10 +100,12 @@
         Queue queue = (Queue) destination;
         Message rc = queue.getMessage(messageId);
         if (rc != null) {
+            rc = rc.copy();
+            rc.getMessage().setRedeliveryCounter(0);
             ActiveMQDestination originalDestination = rc.getOriginalDestination();
             if (originalDestination != null) {
                 ConnectionContext context = BrokerView.getConnectionContext(broker.getContextBroker());
-                return queue.moveMessageTo(context, messageId, originalDestination);
+                return queue.moveMessageTo(context, rc, originalDestination);
             }
             else {
                 throw new JMSException("No original destination for message: "+ messageId);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java?rev=691214&r1=691213&r2=691214&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Tue Sep  2 05:22:51 2008
@@ -850,6 +850,20 @@
         } while (count < this.destinationStatistics.getMessages().getCount());
         return movedCounter;
     }
+    
+    /**
+     * Move a message
+     * @param context
+     * @param r
+     * @param dest
+     * @throws Exception
+     */
+    public boolean moveMessageTo(ConnectionContext context,Message m,ActiveMQDestination
dest) throws Exception {
+        QueueMessageReference r = createMessageReference(m);
+        BrokerSupport.resend(context, m, dest);
+        removeMessage(context, r);
+        return true;
+    }
 
     /**
      * Moves the message matching the given messageId



Mime
View raw message