3 Replies Latest reply on Aug 30, 2010 3:57 AM by Eugene Romanenko

    How to list connected users?

    Eugene Romanenko Newbie

      Hello,

       

      We use JBoss 6 with HornetQ. Clients (swing application) calls EJB3 remote methods and use JMS to subscribe on topics. All calls authorised with an application-policy defined in login-config.xml.

       

      I need to maintain list of "online" users, so I have two questions:

       

      1. How can I list users, which currently have JMS connections? Via JMX I can use JMSServerManager, which have listConnectionIDs() method. However, how can I convert connection ID to caller's Principal?

       

      2. How can I catch "connection closed" events? I need this to maintain actual list of online users, so if user close application (or app crashed, so JMS connection timed out) - I should mark user as "offline".

       

      Thank you.