qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [qpid-broker-j] Dedeepya-T commented on a change in pull request #63: QPID-8472:[Broker-J]Improve operational logging for operations on queue
Date Tue, 06 Oct 2020 10:50:48 GMT

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message