Maximum Listener Thread Settings

There are other listeners that cannot wait for any period of time (for example, TCP or HTTP). The listener must accept the message and pass it to a worker for execution, otherwise the message gets lost.

If there are no workers available to handle the message, you can convert (assign) many of the listeners into queue listeners by writing the message onto an internal queue and then responding to the sender with an "I got it" message. For example, this technique is used (although not with the internal listener) for the AS2 protocol, where a listener takes the message, returns a Message Delivery Notification (MDN), and then proceeds to handle the message. This way, the time for a worker to become available is minimized.

You may want to increase the number of workers running in parallel to handle the actual traffic. For example, in HTTP you might usually expect five simultaneous messages (five workers), but once in a while you may require ten workers. To do this, set the Multithreading parameter to 5 and the Maximum Threads parameter to 10. When the sixth message arrives, the worker pool notices that there are no workers available and creates a sixth worker to acquire the message. This way, the message is not lost. If the sixth worker finishes, it goes back into the worker pool, which now has a total of six workers.

However, because each worker uses resources, the system monitors the pool. After some time has passed, it destroys the sixth worker, since all you require is five. The extra worker was only used to handle the peak situation.

Some listeners do not offer the ability to grow threads, and some do.

You cannot set the Maximum Threads parameter to a value that is less than the value for the Multithreading parameter. The multithreading count is the number of waiting workers. These workers are pre-started to avoid startup time when messages arrive, so the size of the pool is the multithread count. Do not confuse this with Operating System threads. It is not guaranteed that they map one to one, although in most Java Virtual Machines (JVMs) they do.