1 2 Previous Next 22 Replies Latest reply: Jun 22, 2011 7:55 PM by david_b Go to original post RSS
  • 15. Re: JMS bridge doesn't complain, but no msg in destination
    Andy Taylor Master

    Ive just looked at the remoting code, which is what JBM uses, and if 0.0.0.0 is specified it defaults to InetAddress.getLocalHost().getHostAddress() which wouldn't work for you either.

     

    Typically in production you would always specify an interface to use so the server was only available from a specific domain, using 0.0.0.0 could expose the server to domains that it shouldnt.

     

    From an implementation pov, im not sure how we could deal with this anyway.

  • 16. Re: JMS bridge doesn't complain, but no msg in destination
    henk de boer Master

    Andy Taylor wrote:

     

    Ive just looked at the remoting code, which is what JBM uses, and if 0.0.0.0 is specified it defaults to InetAddress.getLocalHost().getHostAddress() which wouldn't work for you either.

     

    Nevertheless, InetAddress.getLocalHost().getHostAddress() does work for a lot of situations I think. I don't think 0.0.0.0 ever works for any situation, does it? At the least it should maybe be covered in some migration guide? It's a major difference from JBM.

     

    The situation where both servers start up binding to 0.0.0.0 and everything then silently fails can be really problematic. I foresee that this is going to cost many teams all over the world a lot of head scratches.

     

     

    From an implementation pov, im not sure how we could deal with this anyway.

     

    Would it be possible to borrow the approach the EJB3 team takes? It obviously does work for them. Or maybe the JBM approach could be used again? Was there a particular reason InetAddress.getLocalHost().getHostAddress() isn't used anymore?

  • 17. Re: JMS bridge doesn't complain, but no msg in destination
    Andy Taylor Master

    Actually i'm just wondering whether Netty (the transport we use) does something similar. I need to talk to one of the netty guys or look at the code.

     

    The difference is not really between JBM and HornetQ but between Remoting and Netty, but i certainly will investigate when i have time and also see what the EJB3 team does, maybe they just do the same.

     

    I'm not sure that silently connectiong to localhost is a good thing tho, in this case the bridge would just connect to itself rather than the actual server which is not good.

  • 18. Re: JMS bridge doesn't complain, but no msg in destination
    david_b Newbie

    henk de boer wrote:

    I foresee that this is going to cost many teams all over the world a lot of head scratches.

    You foresaw correctly

     

    My team has recently encountered this issue. Specifying the IP address in hornetq-configuration.xml isn't an option for us because we need to accept connections from multiple domains (the reason we bind to 0.0.0.0 in the first place).

     

    Any idea if progress has been made on the issue?

  • 19. Re: JMS bridge doesn't complain, but no msg in destination
    Geert Pante Newbie

    What about using hostnames?

    E.g. start up with -b 0.0.0.0 -Djboss.alias.name=`hostname`, and use ${jboss.alias.name} in hornetq-configuration.xml.

    Then you just need to make sure your other servers know how to resolve the hostname for their domain.

  • 20. Re: JMS bridge doesn't complain, but no msg in destination
    henk de boer Master

    Geert Pante wrote:

     

    What about using hostnames?

    E.g. start up with -b 0.0.0.0 -Djboss.alias.name=`hostname`, and use ${jboss.alias.name} in hornetq-configuration.xml.

    Then you just need to make sure your other servers know how to resolve the hostname for their domain.

     

    We found another workaround and that's simply using --host instead of -b when starting up JBoss AS. It's not as convenient as the -b 0.0.0.0, but in our case we have created a rather elaborate shell script that calculates the correct host name with options for local overrides etc. Together with some operations wizardry, this has resulted in a working situation for us.

     

    Still, it's a little weird this is needed for the HornetQ that ships with JBoss AS 6, while for the version that shipped with JBoss AS 5 AND the EJB implementation in JBoss AS 6 it just works with -b 0.0.0.0.

  • 21. Re: JMS bridge doesn't complain, but no msg in destination
    jaikiran pai Master

    henk de boer wrote:

     


    Still, it's a little weird this is needed for the HornetQ that ships with JBoss AS 6, while for the version that shipped with JBoss AS 5 AND the EJB implementation in JBoss AS 6 it just works with -b 0.0.0.0.

    EJB3 doesn't really do anything with that address. It just lets JBoss Remoting handle it. JBoss Remoting internally does this:

     

    if(host == null || InvokerLocator.ANY.equals(host)) // ANYhere is a constant for 0.0.0.0
          {
                  // now need to get some external bindable address
                  try
                  {
                          newHost = (String)AccessController.doPrivileged( new PrivilegedExceptionAction()
                          {
                                  public Object run() throws Exception
                                  {
                                          String bindByHost = System.getProperty(InvokerLocator.BIND_BY_HOST, "True");
                                          boolean byHost = Boolean.valueOf(bindByHost).booleanValue();
                                          if(byHost)
                                          {
                                                  return InetAddress.getLocalHost().getHostName();
                                          }
                                          else
                                          {
                                             return InetAddress.getLocalHost().getHostAddress();
                      }
                   }
                });
             }
    

     

    Reference InvokerLocator

  • 22. Re: JMS bridge doesn't complain, but no msg in destination
    david_b Newbie

    Geert Pante wrote:

     

    What about using hostnames?

    E.g. start up with -b 0.0.0.0 -Djboss.alias.name=`hostname`, and use ${jboss.alias.name} in hornetq-configuration.xml.

    Then you just need to make sure your other servers know how to resolve the hostname for their domain.

     

    I had just tried this and was logging in to post the solution

     

    I used the hostname directly in the hornetq-configuration.xml file though, the alias name solution you have posted is nicer. As long as the other servers resolve the name correctly it does indeed work.

1 2 Previous Next