Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-25313

listConnections Used to return Principal Information

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • A-MQ7, ActiveMQ
    • False
    • None
    • False
    • Customer Escalated

      The old org.apache.activemq.artemis.jms.management.impl.JMSServerControlImpl has a method listConnectionsAsJSON which returns:

      for (RemotingConnection connection : connections) {
              ServerSession session = jmsSessions.get(connection.getID());
              if (session != null) {
                JSONObject obj = new JSONObject();
                obj.put("connectionID", connection.getID().toString());
                obj.put("clientAddress", connection.getRemoteAddress());
                obj.put("creationTime", connection.getCreationTime());
                obj.put("clientID", session.getMetaData("jms-client-id"));
                obj.put("principal", session.getUsername());
                array.put(obj);
              } 
            } 
      

      The newer org.apache.activemq.artemis.core.management.impl.ActiveMQServerControlImpl listConnectionsAsJSON doesn't return the principal information for the user associated with the client:

        JsonArrayBuilder array = JsonLoader.createArrayBuilder();
        Set<RemotingConnection> connections = this.server.getRemotingService().getConnections();
        for (RemotingConnection connection : connections) {
          JsonObjectBuilder obj = JsonLoader.createObjectBuilder().add("connectionID", connection.getID().toString()).add("clientAddress", connection.getRemoteAddress()).add("creationTime", connection.getCreationTime()).add("implementation", connection.getClass().getSimpleName()).add("sessionCount", this.server.getSessions(connection.getID().toString()).size());
          array.add(obj);
        } 
        return array.build().toString();
      

      Is there some way to bring back this capability?

      Getting the principal from the session doesn't always work and necessitates iterating through every connector and getting the session, forcing 100s of jmx calls vs. the previous one call.

              ehugonne1@redhat.com Emmanuel Hugonnet
              rhn-support-dhawkins Duane Hawkins
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated: