You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by shailendra14k <gi...@git.apache.org> on 2018/10/17 10:28:50 UTC

[GitHub] activemq-artemis pull request #2376: [ARTEMIS-2130]Web console display blank...

GitHub user shailendra14k opened a pull request:

    https://github.com/apache/activemq-artemis/pull/2376

    [ARTEMIS-2130]Web console display blank ClientID for the core client

    JIRA:- https://issues.apache.org/jira/browse/ARTEMIS-2130
    
    While using core client. Connection.setClientID(String) , set the ServerSession metadata using the key "jms-client-id"

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/shailendra14k/activemq-artemis ARTEMIS-2130

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/2376.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2376
    
----
commit a730a2891a4cd846ec2e15ea2cb76313b3975e71
Author: Shailendra Kumar Singh <sh...@...>
Date:   2018-10-17T10:24:24Z

    [ARTEMIS-2130]Web console display blank ClientID for the core client

----


---

[GitHub] activemq-artemis pull request #2376: [ARTEMIS-2130]Web console display blank...

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2376#discussion_r227609704
  
    --- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ConnectionView.java ---
    @@ -91,7 +95,14 @@ public Object getField(RemotingConnection connection, String fieldName) {
              case "protocol":
                 return connection.getProtocolName();
              case "clientID":
    -            return connection.getClientID();
    +            String clientID = null;
    +            for (ServerSession session : sessions) {
    +               if (clientID == null) {
    +                  clientID = session.getMetaData("jms-client-id") == null ? connection.getClientID() : session.getMetaData("jms-client-id");
    --- End diff --
    
    jms specifics should not be in core broker. Also this is the connection view, this data is off the session view, so should be visible there, not on the connection. 


---

[GitHub] activemq-artemis pull request #2376: [ARTEMIS-2130]Web console display blank...

Posted by shailendra14k <gi...@git.apache.org>.
Github user shailendra14k closed the pull request at:

    https://github.com/apache/activemq-artemis/pull/2376


---

[GitHub] activemq-artemis issue #2376: [ARTEMIS-2130]Web console display blank Client...

Posted by jbertram <gi...@git.apache.org>.
Github user jbertram commented on the issue:

    https://github.com/apache/activemq-artemis/pull/2376
  
    I agree with @michaelandrepearce - JMS specifics should not be built into the console (or any part of the core broker, for that matter).  The session contains generic meta-data which can be displayed on the console and then users can interpret that meta-data as necessary for their applications.  We've worked hard to get JMS stuff out of the core broker to better support other protocols.  Let's not add it back in.


---

[GitHub] activemq-artemis pull request #2376: [ARTEMIS-2130]Web console display blank...

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2376#discussion_r227610014
  
    --- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ConsumerView.java ---
    @@ -82,7 +82,7 @@ public Object getField(ServerConsumer consumer, String fieldName) {
              case "user":
                 return session.getUsername();
              case "clientID":
    -            return consumer.getConnectionClientID();
    +            return session.getMetaData("jms-client-id") == null ? consumer.getConnectionClientID() : session.getMetaData("jms-client-id");
    --- End diff --
    
    this should not be needed, if anything the session and consumer models should be re-worked to allow for a client id to be set at session level generically.


---

[GitHub] activemq-artemis pull request #2376: [ARTEMIS-2130]Web console display blank...

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2376#discussion_r227610048
  
    --- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ProducerView.java ---
    @@ -79,7 +79,7 @@ public Object getField(ServerProducer producer, String fieldName) {
              case "user":
                 return session.getUsername();
              case "clientID":
    -            return session.getRemotingConnection().getClientID();
    +            return session.getMetaData("jms-client-id") == null ? session.getRemotingConnection().getClientID() : session.getMetaData("jms-client-id");
    --- End diff --
    
    this should not be needed, if anything the session and producer models should be re-worked to allow for a client id to be set at session level generically.
    



---

[GitHub] activemq-artemis issue #2376: [ARTEMIS-2130]Web console display blank Client...

Posted by shailendra14k <gi...@git.apache.org>.
Github user shailendra14k commented on the issue:

    https://github.com/apache/activemq-artemis/pull/2376
  
    @michaelandrepearce @jbertram Thank you for the review. Yes, session and consumer models need to be re-worked and should have a generic method to get/set client_id accros the different client. 
    
    I am closing this PR. 



---

[GitHub] activemq-artemis pull request #2376: [ARTEMIS-2130]Web console display blank...

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2376#discussion_r227609451
  
    --- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ConnectionView.java ---
    @@ -51,10 +51,14 @@ public JsonObjectBuilder toJson(RemotingConnection connection) {
     
           List<ServerSession> sessions = server.getSessions(connection.getID().toString());
           Set<String> users = new HashSet<>();
    +      String clientID = null;
     
           for (ServerSession session : sessions) {
              String username = session.getUsername() == null ? "" : session.getUsername();
              users.add(username);
    +         if (clientID == null) {
    +            clientID = session.getMetaData("jms-client-id") == null ? connection.getClientID() : session.getMetaData("jms-client-id");
    --- End diff --
    
    should avoid jms specifics such as this.
    



---