Setting the Socket Timeout Value

When setting the socketTimeout value, you need to consider the executionTimeout 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 socketTimeout value encapsulates the executionTimeout value. Therefore, the socketTimeout value should be greater than the executionTimeout property because the socket may time out unnecessarily if its value is set to less than the executionTimeout value. The following table lists suggested values for socketTimeout based on executionTimeout 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.

There are two ways to set the socket timeout value. You can either write an application using the JCA Common Client Interface (CCI) to access the getter and setter methods provided with the IMSInteractionSpec or use the tooling provided by Rational Application Developer.

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, you need to instantiate a new IMSInteractionSpec or obtain the IMSInteractionSpec from your specific interaction. Then set the socketTimeout 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

With the first method, using Rational Application Developer, you can set the socket timeout value when you initially define the IMS binding properties for a new J2C Java Bean. To edit the IMS binding properties that are already defined for an IMS service, 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 executionTimeout property, if it is not listed and specify a value for it. If it is listed, modify the value.
  4. Close the editor and click Yes to save your changes.
Related concepts
Execution timeout
Socket timeout
Related tasks
Setting execution timeout values
Related reference
Valid execution timeout values
Connection properties
IMSInteractionSpec properties
Terms of use | Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.