Monitoring server session pools for listener ports
You can minimize the number of resources that server sessions use by enabling server session pool monitoring and defining the timeout value to be applied to a server session.
About this task
Each listener port uses one or more server sessions, which are held in a server session pool. Each server session is associated with a JMS session, which is taken from the JMS session pool that is associated with the JMS connection factory that the listener port is configured to use.
By default, server session pool monitoring is disabled. When a listener port uses a server session the listener port does not release the server session from the server session pool until the listener port is shut down. This means that the associated JMS session is not released into the JMS session pool until the listener port is shut down, even if the listener port is not processing any messages. Consequently the resources that the JMS session uses, for example TCP/IP connections, can be held for a long time, and this can cause problems for resource-constrained systems.
To minimize the number of resources that server sessions use, you must monitor the server session pools. When you enable server session pool monitoring each server session in each server session pool that a listener port uses is monitored to determine how much time has elapsed since the server session was last used. If the elapsed time is greater than the timeout value that you have configured, the server session is removed from the server session pool and its associated JMS session is returned to the JMS session pool. The returned JMS session can be either reused by another application or closed, depending on your JMS session pool settings. You can also configure additional pooling mechanisms, depending on your JMS provider.
Non-ASF mode cannot be selected on z/OS systems.
Procedure
Example
For example, consider an application server that is configured with listener ports lp1, and lp2.
- No properties set
- If none of the properties are set, server session pool monitoring is disabled and JMS sessions used by server sessions are not returned to the JMS session pool until the listener port (lp1 or lp2), or its associated message-driven bean, is shut down.
- SERVER.SESSION.POOL.REAP.TIME and SERVER.SESSION.POOL.UNUSED.TIMEOUT set
- Consider, for example, the following settings:
- SERVER.SESSION.POOL.REAP.TIME=60
- SERVER.SESSION.POOL.UNUSED.TIMEOUT=120
- SERVER.SESSION.POOL.REAP.TIME and SERVER.SESSION.POOL.UNUSED.TIMEOUT set, and overrides set for SERVER.SESSION.POOL.UNUSED.TIMEOUT.lpname
- Consider, for example, the following settings:
- SERVER.SESSION.POOL.REAP.TIME=60
- SERVER.SESSION.POOL.UNUSED.TIMEOUT=120
- SERVER.SESSION.POOL.UNUSED.TIMEOUT.lp2=-1
- SERVER.SESSION.POOL.UNUSED.TIMEOUT.lp1=60