2 Replies Latest reply on Aug 31, 2011 6:14 PM by jendo

    Kick off client from Server in j2ee

    pinkushn

      Hi, all.  I have an odd scenario: occassionally, I want to kick off a 'bad' user using code on the Server side.  I used to break the connection by sending a message to my Client, which then broke the connection from the Client side, but then a bad apple user decompiled and modified my code on his client.  So now I want to be able to cause the kick off entirely from the Server side.  I see HornetQServerControl.closeConnectionsForAddress(String ipAddress), but here's my issue: I do not 'have' the client's ipaddress.

       

      I thought maybe I could get the ip when the client first connected.  I have a hornetq.notifications queue on the Server and I have an MDB that processes all such notifications, so I examined all values from _HQ_NotifType: BINDING_ADDED, but none of them is an ip.  Is there some way to get the ip from some other HQ property, such as _HQ_RoutingName?

       

      Thanks for any help you can give.

       

      Josh

        • 1. Re: Kick off client from Server in j2ee
          jendo

          I don't have an answer but I would also like to know how to kick them.

          • 2. Re: Kick off client from Server in j2ee
            jendo

            I'm not sure if this helps or not, but I had a similar post here.

             

            What you could do on your clients is add the meta data (if your using a version that has that support) to your sessions so you can uniquely identify which connections you expect. Then you can list all the connections using JMSServerControl.listRemoteAddresses. Then you can use JMSServerControl.listConnectionsAsJSON to see which connections are valid (using the meta data client id) and isolate the invalid connection.

            Hopefully that helps.