activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r688118 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx: QueueView.java QueueViewMBean.java
Date Fri, 22 Aug 2008 16:55:46 GMT
Author: jstrachan
Date: Fri Aug 22 09:55:45 2008
New Revision: 688118

URL: http://svn.apache.org/viewvc?rev=688118&view=rev
Log:
added patch for AMQ-1908

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/jmx/QueueViewMBean.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=688118&r1=688117&r2=688118&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
Fri Aug 22 09:55:45 2008
@@ -92,6 +92,21 @@
         return ((Queue)destination).moveMatchingMessagesTo(context, selector, toDestination,
maximumMessages);
     }
 
+    /**
+     * Moves a message back to its original destination
+     */
+    public boolean retryMessage(String messageId) throws Exception {
+        Queue queue = (Queue) destination;
+        Message rc = queue.getMessage(messageId);
+        if (rc != null) {
+            ActiveMQDestination originalDestination = rc.getOriginalDestination();
+            if (originalDestination != null) {
+                ConnectionContext context = BrokerView.getConnectionContext(broker.getContextBroker());
+                return queue.moveMessageTo(context, messageId, originalDestination);
+            }
+        }
+        return false;
+    }
     
     public int cursorSize() {
         Queue queue = (Queue) destination;

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueViewMBean.java?rev=688118&r1=688117&r2=688118&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueViewMBean.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueViewMBean.java
Fri Aug 22 09:55:45 2008
@@ -101,6 +101,11 @@
     boolean moveMessageTo(String messageId, String destinationName) throws Exception;
 
     /**
+     * Moves a message back to its original destination
+     */
+    boolean retryMessage(String messageId) throws Exception;
+    
+    /**
      * Moves the messages matching the given selector
      * 
      * @return the number of messages removed
@@ -145,5 +150,5 @@
      * by the cursor
      */
     public int cursorSize();
-    
+
 }



Mime
View raw message