[ 
https://issues.apache.org/jira/browse/ARTEMIS-5131?focusedWorklogId=940069&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-940069
 ]

ASF GitHub Bot logged work on ARTEMIS-5131:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Oct/24 08:14
            Start Date: 25/Oct/24 08:14
    Worklog Time Spent: 10m 
      Work Description: andytaylor commented on code in PR #5316:
URL: https://github.com/apache/activemq-artemis/pull/5316#discussion_r1816210280


##########
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:
   actually ignore, if you follow the code thru it does use rout on the binding 
itself so it only goes to that queue





Issue Time Tracking
-------------------

    Worklog Id:     (was: 940069)
    Time Spent: 1h 40m  (was: 1.5h)

> Add A Copy message button to console
> ------------------------------------
>
>                 Key: ARTEMIS-5131
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5131
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Andy Taylor
>            Assignee: Andy Taylor
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> This would behave similarly to the move button and would neeed some additions 
> to QueueControl



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to