activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From michaelandrepearce <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #2035: [ARTEMIS-1819] Missing fields on listAl...
Date Sat, 21 Apr 2018 00:52:14 GMT
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2035#discussion_r183194685
  
    --- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
---
    @@ -1943,11 +1958,43 @@ 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());
    +      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());
           if (consumer.getFilter() != null) {
              obj.add("filter", consumer.getFilter().getFilterString().toString());
           }
     
    +      String coreAddress = consumer.getQueue().getAddress().toString();
    +
    +      String[] result = new String[2]; // destination name & type
    +      if (coreAddress.startsWith("jms.queue.")) {
    +         result[0] = coreAddress.substring("jms.queue.".length());
    +         result[1] = "queue";
    +      } else if (coreAddress.startsWith("jms.tempqueue.")) {
    +         result[0] = coreAddress.substring("jms.tempqueue.".length());
    +         result[1] = "tempqueue";
    +      } else if (coreAddress.startsWith("jms.topic.")) {
    +         result[0] = coreAddress.substring("jms.topic.".length());
    +         result[1] = "topic";
    +      } else if (coreAddress.startsWith("jms.temptopic.")) {
    +         result[0] = coreAddress.substring("jms.temptopic.".length());
    +         result[1] = "temptopic";
    +      } else {
    +         logger.debug("Unable to determine the JMS destination of " + coreAddress);
    +         // not related to JMS
    +         result[0] = "";
    +         result[1] = "";
    +      }
    +
    +      obj.add("destinationName", result[0])
    +         .add("destinationType", result[1])
    +         .add("durable", consumer.getQueue().isDurable());
    --- End diff --
    
    This isn't consumer info, this is on the queue level information, please remove


---

Mime
View raw message