2 Replies Latest reply on Jun 20, 2003 7:27 PM by kenseymour

    JBossMQ client problems with two network interfaces (with fi

    kenseymour

      We were having trouble using JBossMQ on client machines that have two network interfaces running.

      Let's say you have two network interfaces with ip addresses nic1 and nic2.
      These ip addresses are on different networks.
      When connecting to a JBossMQ server that is on the same network as nic2,
      the connection would fail, with the server unable to connect back
      to the client because it was using the address for nic1.

      Looking at the source code, I found that in the init method of org.jboss.mq.il.oil.OILClientILService,
      it is doing a call to java.net.InetAddress.getLocalHost to get an InetAddress object.
      This essentially looks up the host name of the client box and uses its ip address
      to initialize the connection.

      For a machine with more than one network interface, this is incorrect.
      What I did to fix this was add code to the init method of org.jboss.mq.il.oil.OILClientILService
      to do a System.getProperty and replace the ip address with the value of this property
      if it has been set.
      If the property has not been set, init reverts to the old behaviour.

      So now we can force the JBossMQ client library to use the address for nic2 if we know that is what we want.

      Would there be any interest in incorporating this change into the official version?