andytaylor commented on code in PR #5316:
URL: https://github.com/apache/activemq-artemis/pull/5316#discussion_r1816099876


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java:
##########
@@ -1361,6 +1361,32 @@ public boolean moveMessage(final long messageID,
 
    }
 
+   @Override
+   public boolean copyMessage(final long messageID,
+                              final String targetQueue) throws Exception {
+      // this is a critical task, we need to prevent parallel tasks running
+      try (AutoCloseable lock = server.managementLock()) {
+         if (AuditLogger.isBaseLoggingEnabled()) {
+            AuditLogger.copyMessage(queue, messageID, targetQueue);
+         }
+         checkStarted();
+
+         clearIO();
+         try {
+            Binding binding = 
server.getPostOffice().getBinding(SimpleString.of(targetQueue));
+
+            if (binding == null) {
+               throw ActiveMQMessageBundle.BUNDLE.noQueueFound(targetQueue);
+            }
+
+            return queue.copyReference(messageID, binding.getAddress(), 
binding);

Review Comment:
   As with the move method this is adding directly to a queue, rerouting it 
would send it to all queus on an address which is wrong. I could do use route 
and add rout-to-id of the queue but would there be any benefit to doing that?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org
For additional commands, e-mail: gitbox-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to