Set up the WebSphere MQ environment
The information in this section is not relevant if your application connects to a queue manager in bindings mode.
Before an application can connect to a queue manager in client mode, the application must set certain fields in the MQEnvironment class. These fields specify the following information, which is used during the connection attempt:
- Channel name
- Host name
- Port number
To specify the channel name and host name, use the following code:
MQEnvironment.hostname = "host.domain.com"; MQEnvironment.channel = "java.client.channel";This is equivalent to an MQSERVER environment variable setting of:
"java.client.channel/TCP/host.domain.com".By default, the Java™ clients attempt to connect to a WebSphere MQ listener at port 1414. To specify a different port, use the code:
MQEnvironment.port = nnnn;
uj11070_