JMS Message Queue, NAT'ed IP - change ?advertised? address
jasonglass Jun 20, 2017 10:55 PMHi All!
So problem, and likely a simple (I hope!) answer! We're using Jboss EAP 6, we have a JMS queue. We're switching to SaaS (unfortunately) so our vendor is trying to connect to the JMS queue, but since its saas, theres FW rules and IP address NAT'ing in place and I believe its causing issues (well i know it is). So basically I'm wondering if theres a way to get the JMS subsystem to *think* its bound to a NAT'ed VIP/IP so when it ?advertises? the connect back port, the remote client doesnt end up with a no route to host exception.
So for example, locally the servers IP in our network is say 10.140.40.157. The JMS is bound to this, everything works properly within our own network, I can consume from the queue. To our vendor, for example 10.140.40.157 is NAT'ed to 10.250.40.157 then the firewall rules NAT this to 10.140.40.157 - however, and though I'm familiar with JMS, it appears when setting up the queue connection factory, that the JBoss server is "saying" hey, you need to connect me me on my real port and IP of 10.140.40.157 and obviously when the vendor tries to connect, since that IP range isnt part of their network, it throws an No route to host exception. So basically the vendor connects to the NAT IP, all is good, but then half way through the communication process the JBoss server says okay, lets continue communicating on this other port and IP and everything will be all good. The problem is, the vendors network doesnt understand how to route that IP. So my question is, is there a way to tell the jms subsystem to ?pretend? its binding to an IP or FQDN thats understood/routeable by the vendor.
So its sort of like the "-b" binding IP/Name. Is there a way to configure the server so its ?advertising? for JMS and Messaging a binding IP address which the vendor can route to rather than its real physical address so the communications can continue?
For example, a simple JMS client has this:
String jndiProps =
"java.naming.factory.url.pkgs=org.jboss.ejb.client.naming\n"
+ "java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory\n"
+ "java.naming.provider.url=remote://10.140.40.157:30202\n" //works
But if you look at the SSL traces as SSL is being enforced we get:
Padded plaintext after DECRYPTION: len = 288
0000: 00 00 FA 72 00 00 00 00 00 00 00 00 00 00 00 00 ...r............
0010: 24 00 24 65 32 38 36 37 63 63 34 2D 35 36 30 31 $.$e2867cc4-5601
0020: 2D 31 31 65 37 2D 61 62 31 63 2D 37 33 37 64 31 -11e7-ab1c-737d1
0030: 65 62 34 61 31 65 66 00 00 01 5C C7 78 74 73 FF eb4a1ef...\.xts.
0040: 00 00 00 05 00 6E 00 65 00 74 00 74 00 79 00 00 .....n.e.t.t.y..
0050: 00 3A 00 3A 6F 72 67 2E 68 6F 72 6E 65 74 71 2E .:.:org.hornetq.
0060: 63 6F 72 65 2E 72 65 6D 6F 74 69 6E 67 2E 69 6D core.remoting.im
0070: 70 6C 2E 6E 65 74 74 79 2E 4E 65 74 74 79 43 6F pl.netty.NettyCo
0080: 6E 6E 65 63 74 6F 72 46 61 63 74 6F 72 79 00 00 nnectorFactory..
0090: 00 03 00 00 00 04 00 70 00 6F 00 72 00 74 03 00 .......p.o.r.t..
00A0: 00 00 05 00 36 00 30 00 30 00 30 00 33 00 00 00 ....6.0.0.0.3...
00B0: 04 00 68 00 6F 00 73 00 74 03 00 00 00 0D 00 0D ..h.o.s.t.......
00C0: 31 30 2E 31 34 30 2E 34 30 2E 31 35 37 00 00 00 10.140.40.157...
00D0: 0B 00 0B 73 73 6C 2D 65 6E 61 62 6C 65 64 03 00 ...ssl-enabled..
00E0: 00 00 04 00 74 00 72 00 75 00 65 00 FF 01 00 00 ....t.r.u.e.....
00F0: 00 09 00 09 75 6E 64 65 66 69 6E 65 64 50 7A 8B ....undefinedPz.
0100: 9C FF 13 DE EB 78 C2 E2 25 50 F9 91 D6 AE 51 91 .....x..%P....Q.
0110: 41 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E A...............
So basically the JBoss JMS server is telling the client, hey, you made a successful connection on the NAT'ed IP, but I want you to talk to me on port 60003 and internal IP 10.140.40.157 which then becomes not route'able as the vendors server doesnt understand that network IP address. If our JMS JBoss server instead gave the NAT'ed IP instead or a FQDN, then everything would likely proceed and work as expected, so how do I get the JMS to advertise it as being bound to a specific IP or FQDN.
Any thoughts all, any help, insight or suggestions would be greatly appreciated!
Thank you in advance!
Jay