The HTTP connector enables OpenJMS clients to connect to the OpenJMS server using HTTP.
This is typically used when firewall restrictions prevent the use of the RMI, TCP, and TCPS connectors.
Clients connect to the OpenJMS server via a webserver. To connect to OpenJMS via a webserver running on the local host, using the default HTTP configuration, construct an InitialContext as follows:
Hashtable properties = new Hashtable(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.exolab.jms.jndi.InitialContextFactory"); properties.put(Context.PROVIDER_URL, "http://localhost:80/"); Context context = new InitialContext(properties);
The Context.PROVIDER_URL property has the format:
"http://<webserver-host>:<webserver-port>/"
Where:
The HTTP connector supports the following connection properties:
Name | Description |
---|---|
"org.exolab.jms.net.http.proxyHost" | Indicates the proxy server to use. Synonymous with the "http.proxyHost" System property. |
"org.exolab.jms.net.http.proxyPort" | Indicates the port of the proxy server. Synonymous with the "http.proxyPort" System property. |
"org.exolab.jms.net.http.proxyUser" | Indicates the user to log in to the proxy server with. |
"org.exolab.jms.net.http.proxyPassword" | Indicates the password to log in to the proxy server with. |
To administer an OpenJMS server via the webserver running on the local host, using the default HTTP configuration, construct a JmsAdminServerIfc as follows:
String url = "http://localhost:80/"; JmsAdminServerIfc admin = AdminConnectionFactory.create(url);
The URL argument has the same format as the Context.PROVIDER_URL described in Using the HTTP connector