The IBM MQ classes for Java configuration file
An IBM MQ classes for Java configuration file specifies properties that are used to configure IBM MQ classes for Java.
The format of an IBM MQ classes for Java configuration file is that of a standard Java properties file.
A sample configuration file, mqjava.config, is supplied in the bin subdirectory of the IBM MQ classes for Java installation directory. This file documents all the supported properties and their default values. Note: The sample configuration file is overwritten when the IBM MQ installation is upgraded to a future Fix Pack. Therefore, it is recommended that you make a copy of the sample configuration file for use with the applications. We can choose the name and location of an IBM MQ classes for Java configuration file. When you start the application, use a java command with the following format:java -Dcom.ibm.msg.client.config.location=config_file_url application_nameIn the command, config_file_url is a uniform resource locator (URL) that specifies the name and location of the IBM MQ classes for Java configuration file. URLs of the following types are supported: http, file, ftp, and jar. The following example shows a java command:
java -Dcom.ibm.msg.client.config.location=file:/D:/mydir/mqjava.config MyAppClassThis command identifies the IBM MQ classes for Java configuration file as the file D:\mydir\mqjava.config on the local Windows system.
When an application starts, IBM MQ classes for Java reads the contents of the configuration file and stores the specified properties in an internal property store. If the java command does not identify a configuration file, or if the configuration file cannot be found, IBM MQ classes for Java uses the default values for all the properties. If required, we can override any property in the configuration file by specifying it as a system property on the java command.
An IBM MQ classes for Java configuration file can be used with any of the supported transports between an application and a queue manager or broker.
Overriding properties specified in an IBM MQ MQI client configuration file
An IBM MQ MQI client configuration file can also specify properties that are used to configure IBM MQ classes for Java. However, properties that are specified in an IBM MQ MQI client configuration file apply only when an application connects to a queue manager in client mode.
If required, we can override any attribute in an IBM MQ MQI client configuration file by specifying it as a property in an IBM MQ classes for Java configuration file. To override an attribute in an IBM MQ MQI client configuration file, use an entry with the following format in the IBM MQ classes for Java configuration file:com.ibm.mq.cfg.stanza.propName=propValueThe variables in the entry have the following meanings:
- stanza
- The name of the stanza in the IBM MQ MQI client configuration file that contains the attribute.
- propName
- The name of the attribute as specified in the IBM MQ MQI client configuration file.
- propValue
- The value of the property that overrides the value of the attribute that is specified in the IBM MQ MQI client configuration file.
Alternatively, we can override an attribute in an IBM MQ MQI client configuration file by specifying the property as a system property on the java command. Use the preceding format to specify the property as a system property.
Only the following attributes in an IBM MQ MQI client configuration file are relevant to IBM MQ classes for Java. If you specify or override other attributes, it has no effect. Specifically, note that the ChannelDefinitionFile and ChannelDefinitionDirectory in the CHANNELS stanza of the client configuration file are not used. See Use a client channel definition table with IBM MQ classes for Java for details of how to use the CCDT with the IBM MQ classes for Java.Stanza | Attribute |
---|---|
CHANNELS stanza of the client configuration file | Put1DefaultAlwaysSync |
CHANNELS stanza of the client configuration file | PasswordProtection |
ClientExitPath stanza of the client configuration file | ExitsDefaultPath |
ClientExitPath stanza of the client configuration file | ExitsDefaultPath64 |
ClientExitPath stanza of the client configuration file | JavaExitsClasspath |
JMQI stanza of the client configuration file | useMQCSPauthentication |
MessageBuffer stanza of the client configuration file | MaximumSize |
MessageBuffer stanza of the client configuration file | PurgeTime |
MessageBuffer stanza of the client configuration file | UpdatePercentage |
TCP stanza of the client configuration file | ClntRcvBuffSize |
TCP stanza of the client configuration file | ClntSndBuffSize |
TCP stanza of the client configuration file | Connect_Timeout |
TCP stanza of the client configuration file | KeepAlive |
- Java Standard Environment Trace stanza
Use the Java Standard Environment Trace Settings stanza to configure the IBM MQ classes for Java trace facility.
Parent topic: What is installed for IBM MQ classes for Java
Related information