Adapter timeout and concurrency
Changes in the behavior of adapter timeout and concurrency starting in IBM MobileFirst Platform Foundation v6.3 have impact on the adapter XML schema.
Timeout and concurrency in IBM MobileFirst Platform Foundation v6.3
Starting in IBM MobileFirst Platform Foundation v6.3, the behavior of timeout and concurrency was modified for HTTP-based, JMS, and SQL adapters.
- HTTP-based adapters
- In earlier versions of MPF, timeout and concurrency were handled by thread pools. They are now enforced by the underlying HTTP framework.
- Timeout:
Previously, you were able to define a timeout for a single procedure. Starting from v6.3, we can use the standard socket timeout and connection timeout provided by HTTP frameworks. A socket timeout defines the time between two consecutive packets, starting from the connection packet. A connection timeout defines the time within which a connection to the back-end must be established.
We can set the socket and connection timeouts in two places:
- To set the default value for an adapter, set it in the adapter XML file. For more details on timeout in the XML file, see The <connectionPolicy> element of the HTTP adapter.
- To set the timeouts for a specific back-end invocation, use the options struct in the invokeHttp() JavaScript function. See WL.Server class.
- Concurrency:
We use the <maxConcurrentConnectionsPerNode> subelement of the <connectionPolicy> element in the adapter XML file to set concurrency limits. See The <connectionPolicy> element of the HTTP adapter.
- JMS adapters
- Timeout: JMS adapter provides several timeout specifications based on the action that is attempted. There has been no change in functionality in that sense but the per-procedure timeout has been removed.
- Concurrency: Starting from IBM MobileFirst Platform Foundation v6.3, concurrency is no longer supported for JMS adapters.
- SQL adapters
- Previously, concurrency and timeout were handled by thread pools. Starting from v6.3, the only method to define concurrency and timeout, is to use the SQL Connection Pool obtained using a JNDI reference.
XML schema changes in IBM MobileFirst Platform Foundation v6.3
IBM MobileFirst Platform Foundation v6.3 uses a new adapter XML schema. Adapters using earlier schemas cannot be used in Studio v6.3 and CLI v6.3. The following are the changes made to the adapter schema during upgrade:
- The requestTimeoutInSeconds attribute of the <procedure> element is no longer supported. During project upgrades IBM MPF v6.3, the attribute is commented out in all <procedure> elements.
- The <loadConstraints> element and its attributes are no longer supported. During project upgrades IBM MPF v6.3, this element is removed.
- In HTTP-based adapters, there are three new elements: <connectionTimeoutInMilliseconds>, <socketTimeoutInMilliseconds>, and <maxConcurrentConnectionsPerNode> under <connectionPolicy>. During project upgrades IBM MPF v6.3, these new elements are added. See The <connectionPolicy> element of the HTTP adapter.
Compatibility with earlier versions
Adapters from previous version work and can be deployed on the MobileFirst Server v6.3. However, they behave differently, as described below.
- HTTP-based adapters
- Timeout:
The value of the requestTimeoutInSeconds attribute of <procedure> elements is now used to set the value of the HTTP socket timeout and connection timeout per procedure. For more information about socket and connection timeout see "HTTP-based adapters" in Adapter timeout and concurrency changes.
- Concurrency:
The concurrency limits are enforced by the underlying HTTP framework, instead of by a thread pool.
- JMS adapters
- The requestTimeoutInSeconds attribute of <procedure> and <loadConstraints> elements is ignored.
- SQL adapters
- The requestTimeoutInSeconds attribute of <procedure> and <loadConstraints> elements is ignored. Use JNDI configuration instead.
Parent topic: Develop the server side of a MobileFirst application