Multithreading in Subscription Service

TIBCO ActiveMatrix Adapter for Database supports multithreading in Subscription Service to improve the performance in high load scenarios. The adapter spreads the subscription message load by using multithreading and avoids blocking the processing on a specific subscription table.

Default Session Without Multithreading
Separate Session with Multithreading

Default Session Without Multithreading

In the default session, Subscription Service without using multithreading shares one session to receive the messages and updates the relevant tables in its associated database.

To use Subscription Service in single threaded mode using the default session, you have to clear the Use Separate Session check box in the Configuration tab of the adapter service.

Separate Session with Multithreading

Subscription Service can also be configured to use separate sessions so that the service can operate using multiple threads.

You can specify the number of Subscription Service threads that are responsible for processing application requests in TIBCO Designer.

To set the number of threads for a configuration, follow these steps:

Procedure 

1. In the Project panel, click the Adapter Subscription Service resource, and then select the Use Separate Session check box in the Configuration tab. The useSerial check box and the Number of Subscription Service Threads field are displayed.
2. Select or clear the useSerial check box depending on whether you want the message to be handled in order.

To ensure the proper functioning of the useSerial option, you have to note the following conditions:

The primary key in the destination table cannot be null.
If the destination table has no primary key, you have to select the User Key check box instead of the primary key. When processing the application requests, the messages are handled in order.
If the destination table has no primary key, and the User Key check box is cleared, it is good practice to clear the useSerial check box.

Figure 88: Configuring Multithreading for Subscription Service