Use separate QCF and TCF for MDBs
Each MDB's listener port is associated to a QCF or TCF. The connection factory objects hold the connection and session pools for accessing the messaging system. When configuring the sizes of these pools there always have to be enough sessions and connections available to allow all parts of the application to access the messaging system at peak load. The more variants there are in working out this peak load the harder it is to get the correct figures for the size of the pools.
The number of connections and sessions that are needed by each listener port on an appserver can be calculated. The number of connections and sessions used by the Web and EJB container cannot be calculated in the same way as it is reliant on the type and spread of workload, which can vary considerably. Only a percentage of requests that arrive at the Web or EJB container will need to use JMS, unlike the listener port where 100% of requests (messages) need to use JMS.
Creating a separate QCF or TCF definition that will only be used by MDBs means that:
- There will always be enough resources available in the connection and session pool to run the listener ports that push work to the MDBs. This is regardless of whether the Web or EJB container are experiencing heavy load.
- There is one less variable to consider when setting up the connection and session pools for the Web and EJB traffic.
- When monitoring performance it is obvious which connections and sessions are in use by listener ports. In Tivoli Performance Viewer objects are shown by the name of the QCF or TCF they use.
For each QCF or TCF associated to a listener port:
- Set the minimum connection pool size to 1 and the maximum connection pool size to 2. The listener port will only ever need one QueueConnection, setting the maximum to 2 is just a precaution.
If the MDBs themselves perform or call code that needs to put a message on a queue using the same QCF or TCF, do not use these figures. Depending on how your application works will determine how many more connections are needed to handle the sending of the message from within the MDB's transaction.
- Set the maximum session pool size to the same value as Maximum sessions in the Listener port configuration.
Once again, if the MDB or code it calls puts a message on a message queue using the same QCF then more sessions might be needed than this.
WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.
Tivoli is a trademark of the IBM Corporation in the United States, other countries, or both.