You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2022/06/29 15:10:27 UTC

[GitHub] [activemq-artemis] clebertsuconic commented on a diff in pull request #4126: ARTEMIS-3875 - adding consumer and producer metrics

clebertsuconic commented on code in PR #4126:
URL: https://github.com/apache/activemq-artemis/pull/4126#discussion_r910058984


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java:
##########
@@ -2752,7 +2753,27 @@ public String listAllConsumersAsJSON() throws Exception {
    }
 
    private JsonObject toJSONObject(ServerConsumer consumer) throws Exception {
-      JsonObjectBuilder obj = JsonLoader.createObjectBuilder().add("consumerID", consumer.getID()).add("connectionID", consumer.getConnectionID().toString()).add("sessionID", consumer.getSessionID()).add("queueName", consumer.getQueue().getName().toString()).add("browseOnly", consumer.isBrowseOnly()).add("creationTime", consumer.getCreationTime()).add("deliveringCount", consumer.getDeliveringMessages().size());
+      List<MessageReference> deliveringMessages = consumer.getDeliveringMessages();

Review Comment:
   this is going to hold a lock on the consumer while the messages are copied over.
   
   
   if you have a bad consumer leaking on acks, this could make things worse to the broker.
   
   Besides this will hold a lock on the ServerConsumer.
   
   Perhaps I'm being over zealous here... but I have seen cases where using the console to find what was wrong actually made things worse.
   
   That's my only concern here.



-- 
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-unsubscribe@activemq.apache.org

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