Connect via proxy
A WebSphere MQ JMS client can connect to a broker through a proxy server. The client connects directly to the proxy server and uses the Internet protocol defined in RFC 2817 to ask the proxy server to forward the connection request to the broker. This option does not work for applets because the Java™ 2 Security Manager normally rejects any attempt by an applet to connect directly to a proxy server.
We can configure a WebSphere MQ JMS client to connect to a broker through a proxy server in either of the following ways:
- In a WebSphere MQ JMS application, use the setProxyHostName() and setProxyPort() methods of an MQConnectionFactory or MQTopicConnectionFactory object to set the proxy host name and proxy port attributes.
- Use the WebSphere MQ JMS administration tool to set the PROXYHOSTNAME and PROXYPORT properties.
If the TRANSPORT property is set to DIRECT, the type of connection to the broker depends on the PROXYHOSTNAME property according to the following rules:
- If the PROXYHOSTNAME property is set to the empty string, the WebSphere MQ JMS client connects directly to the broker using the HOSTNAME and PORT properties to locate the broker.
- If the PROXYHOSTNAME property is set to a value other than the empty string, the WebSphere MQ JMS client connects to the broker through the proxy server identified by the PROXYHOSTNAME and PROXYPORT properties.
uj34730_