How to configure Broker JMS properties

All Broker JMS properties are defined in Java class WmJMSConfig. The documentation for this class can be found in Broker JMS API documentation <install>/Broker/doc/jms_api/index.html. All the properties are static and global. Once set, they are available to any thread in the JVM. There are multiple ways to configure a setting. One example for socket connect timeout is given below.

Configure via static Java API call

You can call WmJMSConfig.setSocketConnectTimeout(10) to set the TCP socket connect timeout to 10 seconds. This can be called from a static initialization code to set the value at program startup.

Configure as Java system property

The corresponding properties key-value pair for setSocketConnectTimeout is "com.webmethods.jms.socket.connectTimeout=10".

For Integration Server, this key-value pair can be added to watt.config.systemProperties. Refer to IS documentation for more details on watt property.

For other applications, pass to JVM as an argument "-Dcom.webmethods.jms.socket.connectTimeout=10".

Configure as Java properties file

You can create a file named wmjms.properties containing one property per line, e.g. for linger timeout in addition to connect timeout

com.webmethods.jms.socket.connectTimeout=10

com.webmethods.jms.socket.lingerTimeout=2

Then you can include the path containing the wmjms.properties file in the class path, e.g. if the full path of the file is /opt/softwareag/Broker/config/wmjms.properties, then include "/opt/softwareag/Broker/config" in the class path as you would usually include a jar file in class path, e.g. "-classpath /opt/softwareag/common/lib/wm-jmsclient.jar;/opt/softwareag/Broker/config".

Configure as Java properties file bundled along with jar

You create wmjms.properties file with required settings and you include it in the wm-jmsclient.jar under package com/webmethods/jms. Now, your wm-jmsclient.jar itself contains the properties, and can be used anywhere.

1 Like