« Return to Thread: FAQ: Unable to create a connection to: [[ServerEntry, hostname="xxxxx", port="yyyy"]]

Re: FAQ: Unable to create a connection to: [[ServerEntry, hostname="xxxxx", port="yyyy"]]

by IIT Software :: Rate this Message:

Reply to Author | View in Thread

As the FAQ entry states:

1) The router determines its own host name and stores it in the connection factory.
2) The connection factory is transfered to the JMS client on a JNDI lookup.
3) The client uses the connection factory to create the actual JMS connection. It uses the host name / IP address stored in the connection factory.

You have to differentiate 2 kinds of connections:

1) The JNDI connection
2) The JMS connection

Concerning 1) you use a JNDI provider URL to connect to SwiftMQ's JNDI. This URL is called the SMQP-URL and looks like this:

   smqp://<ip/host>:<port>/<properties>

For example:

   smqp://192.168.0.47:4001/timeout=10000

Because SwiftMQ's JNDI works over JMS internally, the SMQP-URL just points to a router's JMS listener. You have to use the router's IP address.

Concernig 2) your client uses the JMS connection factory to create a connection. If you want that your JMS client should use the IP address of the router, simply specify it as "connectaddress" attribute and you are done.

So this means, I will have to set all possible ipaddress and hostnames in the etc/hosts that the user might enter.
The user can only enter a limited number of IP addresses - those on which the router is reachable. You can also bind a JMS listener to a particular network card by using the "bindaddress" attribute. That way you don't need to set the "connectaddress" attribute. If you use the "bindaddress" and specify the IP here, the JMS listener is only reachable on this interface and that's it.

Another point is a firewall. If you have your router running inside the firewall using a private class C network, e.g. 192.168.0.0, and you have clients outside the firewall, you need the "connectaddress" set to the public IP of the firewall. The firewall needs to be NAT configured to translate between the public IP/port and the internal IP/port of the router's host.

So actually that's all you have to respect. You neither need to specify many IP addresses nor do you need to set up a proper DNS.

 « Return to Thread: FAQ: Unable to create a connection to: [[ServerEntry, hostname="xxxxx", port="yyyy"]]