0 Replies Latest reply on May 24, 2002 8:15 PM by Maurice Ling

    OILClientILService problem with Multi-homed client

    Maurice Ling Newbie

      Hi All,

      In JBoss 2.4.4 and 2.4.5, I discovered a problem when running a JMS client using OILService on a multi-homed client machine, where the first/default address is not accessible to the remote server. The client does not receive events from the server.


      While the OIL Service enables you to set the BindAddress of the server, there is no equivalent on the client side. The behavior of the OILClientILService is to simply use the default InetAddress using the InetAddress.getLocalHost() method (OILClientILService.java line 280).

      I added a work around to enable setting the InetAddress via a system property, and this did the trick in the init() method:

      //
      // set the local host IP address via System properties (if set)
      //
      final String hostname =
      System.getProperty("org.jboss.mq.client.hostname");
      java.net.InetAddress address = null;

      try
      {
      if (hostname != null)
      {
      address = java.net.InetAddress.getByName(hostname);
      } else
      {
      address = java.net.InetAddress.getLocalHost();
      }
      } catch (java.net.UnknownHostException uhe)
      {
      address = java.net.InetAddress.getLocalHost();
      }
      clientIL = new OILClientIL( address, serverSocket.getLocalPort() );

      Can someone comment on the above solution and possibly integrate into a future build?

      Thanks,

      -Maurice