Multithreading

Using multiple threads, an application can simultaneously process multiple and independent events. TIBCO ActiveMatrix Adapter for Database (TIBCO Business Studio) supports multithreading to efficiently handle requests and increase the response speed of the system.

Multithreading is supported for Publication Service, Subscription Service, and Request-Response Service.

Note: When a group message arrives, no matter how many records there are in the group, the records will be processed by the same thread as a whole.

Multithreading in Publication Service

Each service of Publication Service can be configured with multiple threads that connect to the database separately and then process requests in parallel. You can set the number of threads for Publication Service by configuring the Number of Publication Service Threads field in the Publication Options tab.

Note: Load balancing and multithreading cannot coexist in Publication Service.

Multithreading in Subscription Service

To improve the performance in high load scenarios, the adapter uses multiple threads to spread a subscription message load, which prevents blocking the processing on a specific subscription table.

Note: When you configure multithreading in Subscription Service, note the following:
  • TIBCO Hawk statistics display all Subscription Service thread information and operation counts.
  • Debug messages provide Subscription Service thread names to distinguish which message is from which Subscription Service thread.
Note: If a Subscription Service thread encounters fatal errors that the adapter cannot handle, the adapter terminates. Fatal errors include but are not limited to the following:
  • Fail to roll back a transaction.
  • Fail to insert received data into the destination table, but the exception table is not configured.
  • Fail to insert error data into the exception table, but the opaque exception table is not configured.
  • Fail to insert error data into the opaque exception table.

The use of multithreading is directly related to the session to be used for Subscription Service. For details, see Multithreading and Session in Subscription Service.

Although multithreading helps improve the performance of Subscription Service, the improvement is affected by what table structures are selected for Subscription Service, a single table or a parent-child table. For details, see Multithreading and Tables for Subscription Service.

Multithreading in Request-Response Service

You can improve the performance of Request-Response Service by specifying the number of threads to process application requests. Each Request-Response Service thread is dedicated to listen on an agreed request subject.

You can set multithreading at the adapter configuration level or the adapter service level:
  • To set multithreading at the adapter configuration level, configure the Number of Request-Response Service Default Session Threads field in the Advanced tab of an adapter configuration.
  • To set multithreading at the adapter service level, configure the Request-Response Options tab of Request-Response Service:
    1. Select the Use Separate Session check box.
    2. Specify a value in the Number of Request-Response Service Threads field.
Note: If you set multithreading at both the adapter configuration level and the service level, Request-Response Service takes the thread number at the adapter service level during the process.

The configuration of multithreading is directly related to the session to be used for Request-Response Service. For details, see Multithreading and Session in Request-Response Service.