Using Proxy Connections in the JMS API

You can establish a connection to an event broker within your private network via an HTTP or SOCKS5 proxy server, which avoids the need for individual firewall exceptions. The proxy configuration is set with system properties, that are usually set on the java command line or JVM. It is important to note that system properties set on a JVM instance apply to all java applications running on the same JVM.

 

Properties for Proxy Server Configuration Example JVM Command

Proxy Server Host

This parameter is required for all proxy connection. It can be a hostname or IP address:

java -Dsolace.proxy.host=proxy.example.com javaApp
or
java -Dsolace.proxy.host=192.168.1.100 javaApp

Proxy Server Type

If the server type is not set, it defaults to http. This parameter can only be set to http or socks5:

java -Dsolace.proxy.type=http javaApp
or
java -Dsolace.proxy.type=socks5 javaApp            

Proxy Server Port

If the server port is not set, it defaults to 3128 for http and 1080 for socks5:

java -Dsolace.proxy.port=8080 javaApp 

Proxy Server Username

If you set a server username, you must also set a server password:

java -Dsolace.proxy.username=my_proxy_username javaApp					

Proxy Server Password

java -Dsolace.proxy.password=my_proxy_password javaApp					

The following code snippet sets all proxy server parameters:

java -Dsolace.proxy.type={http} -Dsolace.proxy.host={proxy.example.com} \
			-Dsolace.proxy.port={8080} -Dsolace.proxy.username={my_proxy_username} \
			-Dsolace.proxy.password={my_proxy_password} javaApp