clebertsuconic commented on code in PR #5316: URL: https://github.com/apache/activemq-artemis/pull/5316#discussion_r1815517703
########## 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: The implementation details here should be part of the Queue::copyReference. Also... what if the targetQueue was passed a topic. Shouldn't this call PostOffice::route instead?... on that case targetQueue here should be targetAddress... I started writing a test to validate this test and I bumped into 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