1 Reply Latest reply on May 28, 2006 5:09 PM by tom.elrod

    InvokerLocator: Why always resolve(host) ?

    elkner

      I'm currently trying to fix jboss to allow naming + ejb3 transport completely via http[s] and to get it working via tunneled connections.

      The problem I see is, that InvokerLocator always tries to resolve the host to an inetAddress/its own hostname in the constructor. This IMHO not very useful, since the client should resolve the address and NOT the server, because the server e.g. of an intranet may have a complete different view wrt DNS, than the requesting client, which may live in another intranet (i.e. has another DNS view). Also wrt. performance, it might be valueable to delegate that work to the client, anyway ...

      So what do you think?
      Or is it at least possible, to add a setter for scheme, host and port, so that one is able to overwrite bogus information ?

        • 1. Re: InvokerLocator: Why always resolve(host) ?

          There is already a forum thread on this (http://www.jboss.com/index.html?module=bb&op=viewtopic&t=82345&start=0&postdays=postDays&postorder=postOrder&highlight=highlight) and a jira issue (http://jira.jboss.com/jira/browse/JBREM-497).

          Although I still perfer to resolve a host name only once (and not per call) I can certainly see there are cases in which delaying the resolution until reaches the client would be beneficial. So the jira issue basically states that if someone configures to use host name, it will be used.

          However, one of the real problems with this is what to do about the InvokerLocator's equals() method. Currently it compares the hash code of the internal uri value. So if have 'socket://localhost:1234' and 'socket://127.0.0.1:1234' they will not evaluate as being equal. One way to get around this would be to during runtime, check the ip value of the host name and evaluate that way. However this will make things like putting a InvokerLocator in a HashMap very expensive as will have to do a resolution on the host name each time.

          If have any suggestions on how to solve this problem, will make resolution of this issue come much faster.

          Thanks.

          -Tom