1 Reply Latest reply on Feb 6, 2015 11:34 AM by jbertram

    How to know the socket being used on JMS?

    jamesviet

      I used client and the client will create a connection to server via HornetQ and Netty

       

      Each of 1 minute, server will send heart beat and client (who subscribered) will be received this message. In the message, I included the root IP of server

       

      Everything will be OK if this server had only 1 network card (NIC).

       

      But in the case, server have 2 or more network cards. I met issue.

       

      In the message is received by client, the IP of server not right.

       

      I used InetAddress.getLocalHost().getHostAddress() to get to root IP and I known it wrong in this case server had 2 NICs

       

      So can you give me some advise, how I can get right IP here?

       

      Some guys said we can refer "the socket being used for getting right IP". Do you know how we can get it?

       

      Thanks in advanced,

        • 1. Re: How to know the socket being used on JMS?
          jbertram

          If you have two NICs on the box then I assume you're already telling the application server which one to use (e.g. using the -b command line parameter or "jboss.bind.address" system property).  Why not simply look up the value of the "jboss.bind.address" system property and use that?