I have 3 machines with the following IP addresses : -
Machine 1 (windows) 10.10.10.20
Machine 2 (linux) 10.10.10.21
Machine 3 (windows) 10.10.10.22
I am working on an application that uses EJB, JMS, etc.
Story so far : -
I added the following line to run.bat for the jBoss server installed on Machine 1 to make jBoss NAT aware.
set JAVA_OPTS=%JAVA_OPTS% -Dsimulation=false - Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 - Djava.rmi.server.hostname=10.10.10.21 -Djboss.bind.address=10.10.10.21 -Djava.rmi.server.useLocalHostname=false
The jBoss server was started on Machine 1 and Machine 3 was used as a client.
I configured iptables rules (Destination NAT) on Machine 2 in such a way that any requests made to the following ports on Machine 2 were forwarded to Machine 1.
1. http (80)
2. RMI (1098)
3. Naming service (1099)
I installed a packet sniffer on Machine 3 (client) and typed the ip address of Machine 2 in the web browser. My application was launched as expected. Looking at the data generated by the packet sniffer, I could confirm that all http(80), rmi(1098), and naming service requests(1099) made by my application on Machine 3 had the destination ip address for Machine 2.
However, there were a lot of requests made by my application on Machine 3 which were going directly to Machine 1 (and vice-verse ) for some ports. A few of the ports were : -
1. 4457 (I guess this is the JMS bi-socket port).
2. 3873 (No idea about where this port is used)
3. 25665 (No idea about where this port is used either)
My question is as follows: -
We specify the bind address in run.bat to make jBoss NAT aware. Even after accessing the application (deployed on Machine 1) in the web browser ( on Machine 3 ) through Machine 2, why does Machine 3 communicate with Machine 1 directly and not through Machine 2 in case of some ports as mentioned above?
What jBoss configuration files need to be modified so that JMS communication from Machine 3 to Machine1 (and vice-verse) happens through Machine 2 and not directly?