Java CAPS JMS Reference

JMS IQ Manager Database

The JMS IQ Manager uses the JMS IQ Manager database to store persistent messages. The database is also used to store messages that are larger than can be kept in the JMS IQ Manager memory, which is determined by the cache size setting (by default 0.5 MByte for Windows and 1 MByte for UNIX®). By default, JMS clients are configured for persistent messaging; therefore, in a default configuration, the database is used to store these messages. The messages are stored until they are consumed or until the expiration period expires, which is 30 days by default. See Maximum Lifetime.

Database Files

The database resides in the message server folder on the Logical Host. The database consists of a number of database files called segments. A segment is a disk-space store that is memory-mapped on the server. The segments act together to form the equivalent of a sequential database. By default, these files are named stcms*.dbs.

The JMS IQ Manager creates four segments in the database when it starts up initially. The default size of a segment is 8 MBytes on Windows and 16 MBytes on UNIX. The JMS IQ Manager creates as many segments as necessary. Before running your Java CAPS Project, it is important to set the segment size to a larger value than the largest transaction the JMS IQ Manager may need to process, since the JMS IQ Manager cannot accommodate a transaction that is larger than the segment size.


Note –

The transaction size is the sum of the sizes of the individual messages involved.


You can configure such properties as database filenames, segment size, and the maximum and minimum number of segments created. For more information, refer to Segment Properties.

Database Location

The JMS IQ Manager database resides in the directory specified by the JMS IQ Manager Data directory property as described in Data Directory. The standard location for the database files is described in Database Configuration and Operation

If journaling is enabled, the instance1 directory also contains a Journal directory, unless another location has been specified for the Journal Directory property. The Journaling directory holds the journaling database files. For information, refer to Journal Directory. Journaling is disabled by default.

Database Configuration and Operation

The default configuration for the JMS IQ Manager database is as follows:

When the JMS IQ Manager starts up, the database consists of four segments; the total size of the database is 32 MBytes on Windows and 64 MBytes on UNIX.

Figure 1–4 JMS IQ Manager Database Structure

Diagram explained in accompanying text.

On startup, the JMS IQ Manager performs the following operations:

  1. It allocates sufficient disk space to hold the minimum number of segments.

    The preceding figure shows a JMS IQ Manager allocation of four segments, numbered 7ef325 through 7ef328.

  2. As messages arrive, they are appended to the first segment until the segment is full.

    When a segment is full, the JMS IQ Manager stores subsequent messages in the first free segment.

    The preceding figure shows that the third segment, 7ef327 in file stcms7ef327.dbs, is almost full.

  3. If no segment is free, the JMS IQ Manager allocates a new segment if possible.

  4. Memory is released as soon as the consumer has acknowledged the message or committed the transaction.

  5. When all messages in a segment have expired or been removed from their queues, the JMS IQ Manager cleans up the segment, freeing it for reuse.

    In the preceding figure , the first segment (7ef325) has several segments that are white, indicating the slot is marked eligible. The segment is therefore almost ready for cleanup.