Dedeepya-T commented on a change in pull request #63:
URL: https://github.com/apache/qpid-broker-j/pull/63#discussion_r500180619



##########
File path: 
broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
##########
@@ -3520,23 +3520,52 @@ public MessageEnqueueRecord getEnqueueRecord()
                                                                           
destination,
                                                                           
parseSelector(selector),
                                                                           
limit);
-        _virtualHost.executeTransaction(transaction);
+        performOperationWithLogging("Copy",destination, transaction);
         return transaction.getModifiedMessageIds();
 
     }
 
+    private void performOperationWithLogging(final String msg,final Queue<?> 
destination, final QueueSizeLimitRespectingTransaction transaction)
+    {
+        String status = "FAILED";
+        try
+        {
+            _virtualHost.executeTransaction(transaction);
+            status = "SUCCESS";
+        }
+        finally
+        {
+            logOperation(String.format(msg+"Messages 
:source-%s:target-%s:messagecount-%d:status-%s",
+                                       getName(),
+                                       destination.getName(),
+                                       
transaction.getModifiedMessageIds().size(),
+                                       status));
+        }
+    }
+
     @Override
     public List<Long> deleteMessages(final List<Long> messageIds, final String 
selector, int limit)
     {
         DeleteMessagesTransaction transaction = new 
DeleteMessagesTransaction(this,
                                                                               
messageIds,
                                                                               
parseSelector(selector),
                                                                               
limit);
-        _virtualHost.executeTransaction(transaction);
-
+        String status = "FAILED";

Review comment:
       Refactored to use the common method




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to