Sanjiv Jivan wrote:
> MachineA which is the client is multi homed and has two IP's, IP1, and
> IP2.   IP1 is not accessible to MachineB. MachineB also cannot resolve the
> machine name 'MachineA' as it does not have and entry in its host file
> mapping MachineA to its public IP.

As long as packets from MachineA destined to MachineB aren't routed via
IP1's interface, it doesn't really matter what IP1's address is.

Configure your machines properly.  Don't expect networking to work when
you know for a fact that it's broken.

> When the client on MachineA makes a call to the server on MachineB, the
> server gets the name "MachineA" in the transport layer (when activemq
> logging it turned on) which it cannot resolve.

See part 2 above.

> I could add an entry in Machine B's host file associating the name MachineA
> with the public IP of MachineA however AFAIK the RMI solution of setting
> java.rmi.server.hostname does not require changes to the host file because
> if I had passed -Djava.rmi.server.hostname=<machine a's public IP> when
> starting the JVM on Machine A, then this value is used durning
> communication
> with the server. as a result Machien B would see MachineA's public IP.

Yes, you could, and then you could end this thread because things would
work as expected. :)

> With Lingo / Active MQ, passing -Djava.rmi.server.hostname=<machine a's
> public IP> on the MachineA's JVM doesnt help as "MachineA" is still sent to
> the server which it cannot resolve. I did a quick test passing -
> Djava.rmi.server.hostname=<machine a's public IP> and calling
> 
> InetAddress inetaddress = InetAddress.getLocalHost();
> String hostName = inetaddress.getHostName();
> 
> the hostName returned is still "MachineA" and not the one overridden by "
> java.rmi.server.hostname".

What hostname is being sent in the RMI packets?  Your presumption that a
getLocalHost call outside of the RMI implementation matters is flawed.

> So I think that ActiveMQ is just calling InetAddress.getLocalHost() which
> does not end up using the "java.rmi.server.hostname" override.

AMQ drives Sun's RMI implementation?

-- 
Christopher G. Stach II

Reply via email to