Setting socket timeout values

When setting the socket timeout value, it must be greater than the execution timeout value.

The executionTimeout property is the maximum amount of time allowed for IMS™ Connect to send a message to IMS and receive a response from IMS. The socket timeout value encapsulates the execution timeout value. Therefore, the socket timeout value should be greater than the execution timeout value because the socket may time out unnecessarily if its value is set to less than the execution timeout value. The following table lists suggested values for socket timeout based on execution timeout values.

Execution Timeout Value (milliseconds) Execution Timeout Behavior Suggested Socket Timeout Value
0 (or no value) The default value from the IMS Connect configuration file is used. The socket timeout value should be greater than the execution timeout default value specified in the IMS Connect configuration file.
1 - 3,6000,000 The wait response times out after the specified millisecond value. The socket timeout value should be greater than the execution timeout value.
-1 The wait response is indefinite. Set the socket timeout value to 0 so that the connection waits indefinitely.

The socket timeout value may be set using two methods. You can use the JCA Common Client Interface (CCI) to access the getter and setter methods provided with the IMSInteractionSpec to write an application, or use the tooling provided by the IDEs of the Rational® Software Developer platforms, such as Rational Application Developer with the optional J2EE Connector Architecture (J2C) feature.

Using the CCI application to set a socket timeout value

If you are creating a CCI application, you will have access to the setSocketTimeout method of the IMSInteractionSpec. To use the setSocketTimeout method, instantiate a new IMSInteractionSpec or obtain the IMSInteractionSpec from your specific interaction, and set the socket timeout value for the IMSInteractionSpec by using the setSocketTimeout method provided by the IMSInteractionSpec class. For example:

interactionSpec.setSocketTimeout(timeoutValue1);
interaction.execute(interactionSpec,input,output); 

interactionSpec.setSocketTimeout(timeoutValue2);
interaction.execute(interactionSpec,input,output);

Using Rational Application Developer to set a socket timeout value

You can use Rational Application Developer to set the socket timeout value when you initially define the IMS binding properties for a new J2C Java™ Bean.

To edit the operation binding properties that are already defined for a new J2C Java Bean, complete the following steps:

  1. Open the appropriate IMS binding Java file using the Java Editor.
  2. Locate the doclet tag for the IMSInteractionSpec class.
  3. Modify the doclet tag to add the socketTimeout property and specify a value for it. If this property is already listed, modify the value.
  4. Select the operation extensibility element again to indicate that changes have been made.
  5. Close the editor and click Yes to save your changes.

Feedback