A client application must use an appropriately configured connection factory administered object to make an HTTP connection to a broker. This section discusses HTTP connection configuration issues.
To enable HTTP support, you need to set the connection factory’s imqAddressList attribute to the HTTP tunnel servlet URL. The general syntax of the HTTP tunnel servlet URL is the following:
where hostName:portNumber is the name and port of the Web server/application server hosting the HTTP tunnel servlet and contextRoot is a path set when deploying the tunnel servlet on the Web server/application server.
For more information on connection factory attributes in general, and the imqAddressList attribute in particular, see the Message Queue Developer's Guide for Java Clients.
You can set connection factory attributes in one of the following ways:
Using the -o option to the imqobjmgr command that creates the connection factory administered object (see Adding a Connection Factory), or set the attribute when creating the connection factory administered object using the Administration Console (imqadmin).
Using the -D option to the command that launches the client (see the Message Queue Developer's Guide for Java Clients).
Using an API call to set the attributes of a connection factory after you create it programmatically in client code (see the Message Queue Developer's Guide for Java Clients).
You do not need to configure multiple Web servers/application servers and servlet instances if you are running multiple brokers. You can share a single Web server/application server and HTTP tunnel servlet instance among concurrently running brokers. If multiple broker instances are sharing a single tunnel servlet, you must configure the imqAddressList connection factory attribute as shown below:
http://hostName:portNumber /contextRoot/tunnel?ServerName= bkrHostName:instanceName
Where bkrHostName is the broker instance host name and instanceName is the name of the specific broker instance you want your client to access.
To check that you have entered the correct strings for bkrHostName and instanceName, generate a status report for the HTTP tunnel servlet by accessing the servlet URL from a browser. The report lists all brokers being accessed by the servlet:
HTTP tunnel servlet ready. Servlet Start Time : Thu May 30 01:08:18 PDT 2005 Accepting TCP connections from brokers on port : 7675 Total available brokers = 2 Broker List : jpgserv:broker2 cochin:broker1
If you are using an HTTP proxy to access the HTTP tunnel servlet:
Set http.proxyHost system property to the proxy server host name.
Set http.proxyPort system property to the proxy server port number.
You can set these properties using the -D option to the command that launches the client application.