Chapter 8 Message Service Tuning
Using a thread pool can significantly improve performance. For applications that use the JMS API, create thread pools in EAServer Manager as described in "Thread pools" in the EAServer System Administration Guide. If using jagtool, create and configure thread pools with the jmscreate and jmsset_props commands, respectively. In applications that call the EAServer CtsComponents::MessageService API, you can create thread pools programmatically. For details, see "Creating thread pools programmatically" in the EAServer Programmer's Guide.
For EJB MDB components and other components that you install as message listeners, EAServer by default delivers messages using a single worker thread (the default thread pool is <system> and cannot be modified). The default configuration guarantees first-in-first-out (FIFO) processing of messages in the queue, based on message priority: EAServer delivers messages serially to one component instance. If you do not require FIFO message ordering, use a customized thread pool to increase throughput. When you use a thread pool with multiple worker threads, EAServer creates multiple component instances that run in different worker threads to process messages concurrently.
When a thread pool is used for client notification, the message queue object is implemented with a specialized server IIOP handler that uses only a few waiting threads to handle blocking receive calls, so it avoids waking large numbers of threads for client notification.
Assigning a thread pool to an MDB
Assigning a thread pool to an MDB component allows EAServer to create multiple instances for concurrent message processing on different threads. Create and assign the thread pool as follows:
MyPkg/MyComp[threadsl]
.
Assigning a thread pool to a message listener using non-EJB components
EAServer allows you to create non-EJB components that act as message listeners, as described in "Listeners" in the EAServer System Administration Guide. Use a thread pool to allow concurrent message processing by multiple instances of the component. To create and assign the thread pool:
package_name/component_name[threadpool_name]
Using a thread pool for client notifications
Using thread pools to improve performance is generally suitable only for high-volume client notification with transient messages. When message delivery is transactional or IIOP/SSL via the QOP property, the thread pool's reader and writer threads are not used. To create client applications that use the thread pool:
| Copyright (C) 2004. Sybase Inc. All rights reserved. |
| |