Connection differences
The way you program for WebSphere MQ classes for Java has some dependencies on the connection
modes you want to use.
Client connections
When WebSphere MQ classes for Java is used as a client, it is similar to the WebSphere(R) MQ C client,
but has the following differences:
- It supports only TCP/IP.
- It does not read any WebSphere MQ environment variables at startup.
- Information that would be stored in a channel definition and in environment
variables is stored in a class called Environment. Alternatively, this information
can be passed as parameters when the connection is made.
- Error and exception conditions are written to a log specified in the MQException
class. The default error destination is the Java(TM) console.
- It does not access information stored in a qm.ini file, or the
equivalent information stored in the Windows Registry. Entries in a qm.ini
file, such as the KeepAlive entry, are therefore ignored.
When used in client mode, WebSphere MQ classes for Java does not support the MQBEGIN
call or fast path bindings.
For general information on WebSphere MQ clients, see the WebSphere MQ Clients book.
Bindings mode
The bindings mode of WebSphere MQ classes for Java differs from the client modes in the following
ways:
- Most of the parameters provided by the MQEnvironment class are ignored
- The bindings support the MQBEGIN call and fast path bindings into the WebSphere MQ queue manager
Note:
WebSphere MQ for iSeries and WebSphere MQ for z/OS do not support the use of MQBEGIN to initiate
global units of work that are coordinated by the queue manager.
Defining which connection to use
The connection is determined by the setting of variables in the MQEnvironment
class.
- MQEnvironment.properties
- This can contain the following key/value pairs:
- MQEnvironment.hostname
- Set the value of this variable follows:
- For client connections, set this to the host name of the WebSphere MQ server
to which you want to connect
- For bindings mode, set this to null