Connecting to a remote swiftmq router under a firewall

View: New views
2 Messages — Rating Filter:   Alert me  

Connecting to a remote swiftmq router under a firewall

by paksiw :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have swiftmq router running on a remote machine that has a firewall. Is it possible to just enable the specific port (e.g. 7900 as configured in my routerconfig.xml) in the firewall to enable a client to connect to my remote swiftmq router?
Or once a client contacts the swiftmq router, does it negotiate and tries to continue connection on a separate port?




Re: Connecting to a remote swiftmq router under a firewall

by IIT Software :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A firewall splits internal and public network. On the public side of the f/w is the public IP address and internal are usually an internal IP address block. So if you want to connect from public to internal, you need to define a network address translation (NAT) at your firewall which maps a public port (e.g. 7910) of your firewall to an internal host:post. So whenever someone connects at public:7910 it is routed to internal:port.

So this NAT entry at your firewall is the first prerequisite.

Next is to configure SwiftMQ.

1) You connect to SwiftMQ's JNDI via the JNDI provider URL. In SwiftMQ this is the smqp-URL. Here you connect to your firewall's public address/hostname and the port you have defined for a new JMS listener (see below), e.g. "smqp://company.com:7910/timeout=10000".

2) You lookup a JMS connection factory which is used to establish the actual JMS connection. So your connection factory must contain some infos that you will connect via the firewall. To accomplish this you need to create a new JMS listener (e.g. on port 7910) and define attribute "connectaddress" which must contain the public IP of your firewall.

That's it. Your client now connects to SwiftMQ's JNDI on smqp://company.com:7910/timeout=10000, looks up a connection factory bound to your new listener, e.g. firewallcf. This connection factory contains the public IP of your firewall so a JMS connection is created on public:7910 which is routed to your internal SwiftMQ Router host via NAT.