From commits-return-9156-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Tue Sep 02 12:23:19 2008 Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 72991 invoked from network); 2 Sep 2008 12:23:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Sep 2008 12:23:17 -0000 Received: (qmail 82924 invoked by uid 500); 2 Sep 2008 12:23:13 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 82905 invoked by uid 500); 2 Sep 2008 12:23:13 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 82894 invoked by uid 99); 2 Sep 2008 12:23:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2008 05:23:13 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2008 12:22:22 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 206F12388986; Tue, 2 Sep 2008 05:22:53 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@activemq.apache.org From: rajdavies@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080902122253.206F12388986@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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