2 Replies Latest reply on Mar 14, 2008 6:22 AM by Kevin Tunstall

    Using non-localhost IP/host for esbmessage exchange between

    Kevin Tunstall Newbie

      Hi!

      I'm pretty new to JBossESB, so forgive me if this has been answered elsewhere.

      Now to my problem:
      Due to some 3rd party software restrictions I am using the JBossESB 4.2 GA (not 4.2.1 GA). I changed the configs to reflect using another host than localhost as written in:
      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=123084
      I also changed the "-b" parameter, and enabled the ServiceBindingManager using the default

      <server name="ports-default">
      part.

      Using only my external non-esb-aware service it works fine, I can receive messages from it, and using JMS I can send outbound messages back to it, but obviously that's the easy party.

      Now I have a 2nd ESB service running within the same JBossESB server, so both Service1 and Service2 have their own Gw-Queue and Esb-Queue. When I send a ESBmessage from Service1 to the queue of Service2, using the code from the quickstart tutorial:
      public static void main(String args[]) throws Exception
       {
      // Setting the ConnectionFactory such that it will use scout
       System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
      
       if (args.length < 3)
       {
       System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
       }
      
       Message esbMessage = MessageFactory.getInstance().getMessage();
      
       esbMessage.getBody().setByteArray(args[2].getBytes());
      
       new ServiceInvoker(args[0], args[1]).deliverAsync(esbMessage);
      
       }

      which I changed a bit to:
      public static void test throws Exception
       {
       String sCat...
       String sName...
       String sTestMsg...
      
      // Setting the ConnectionFactory such that it will use scout
       System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
      
       Message esbMessage = MessageFactory.getInstance().getMessage();
      
       esbMessage.getBody().setByteArray(sTestMsg.getBytes());
      
       Message response = new ServiceInvoker(sCat, sName).deliverSync(esbMessage);
      
       }

      Instead of using my configured host it is using "localhost" in the EPR. Since the ESB server itself is not configured to listen on localhost I get the following exception:
      13:48:19,466 INFO [ServiceInvoker] Unresponsive EPR: EPR: PortReference < <wsa:Address jms://localhost/queue/test_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : jnp://mytesthost.com:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jboss.naming:org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> >
      13:48:37,421 INFO [JmsConnectionPool] Received NamingException, refreshing context.
      13:48:49,439 INFO [ServiceInvoker] Unresponsive EPR: EPR: PortReference < <wsa:Address jms://localhost/queue/eclipse_quickstart_helloworld_Request_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : jnp://127.0.0.1:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jboss.naming:org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> >


      How would I go about change the jms address in that esbmessage to use something other than localhost? I know how I do that with standard JMS (using
      props.put(Context.PROVIDER_URL, "jnp://mytesthost.com:1099");
      ), I simply assumed the ESB would take the configured host or the host from the -b startup parameter, not localhost.

      Also, which I think is quite odd: I went through all the config files, actually through all the files, and there isn't an "eclipse..." queue configured anywhere at all. I also undeployed, cleaned and deployed my projects to make sure no "old version" is haunting the esb.