Java CAPS JMS Reference

Enqueued Message Properties

Messages contained within a message destination (queue or topic) are assigned certain properties for the length of time that they reside in the message destination. These properties are displayed when you check the status of the message destination using either Enterprise Manager or the command-line MS Control utility. See JMS Provider Management.


Note –

Whenever unconsumed messages exist in the topic or queue, the message having the first enqueue time will have the minimum sequence number and the message having the last enqueue time will have the maximum sequence number.


Enqueue Time

Each message is given a message enqueue time by the JMS IQ Manager when a message is added into a queue or topic. This value is determined by the server side and is unique across a topic or a queue. For a transaction session, the message enqueue time is determined by the JMS IQ Manager when a message is committed. For a non-transaction session, the message enqueue time is determined by the JMS IQ Manager when the JMS IQ Manager receives the message.

The first enqueue time of a topic or queue is the enqueue time of the first unconsumed message in the topic or queue. The last enqueue time of a topic or queue is the enqueue time of the last unconsumed message in the topic or queue. If no unconsumed message exists in the topic or queue, then the last enqueue time and the first enqueue time are identical, and represent the enqueue time of the most recently consumed message in the topic or queue.

The following example displays the current status of the queue PTP:


stcmsctrlutil -host localhost -port 24055 -queuestat PTP
Queue Name: PTP
First enqueue time: 03212005:08:33:09
Last enqueue time: 03212005:08:33:10
Number of current receivers: 2
Message count: 4
Messages sent and committed: 245
Min sequence number: 245
Max sequence number: 248
Suspended: No

In this example, four messages are in the queue PTP. The first enqueue time is the enqueue time of the first message, which is 03212005:08:33:09, and the last enqueue time is the enqueue time of the fourth message, which is 03212005:08:33:10. If all four messages are consumed, both the first and last enqueue times become the enqueue time of the fourth message, which is 03212005:08:33:10.

In the initial state, where the JMS IQ Manager has not received or consumed any messages in the topic or queue, both the first and last enqueue times are N/A.


Note –

You should not change the clock of the computer on which the JMS IQ Manager is running once the JMS IQ Manager is configured. If you do, the message enqueue time will be incorrect.


Sequence Number

Each message has a message sequence number that is assigned by the JMS IQ Manager when the message is added to the queue or topic. The message sequence number provides a message index, represented as a long integer value, and is unique across a topic or queue. For a transaction session, the message sequence number is determined by the JMS IQ Manager when a message is committed. For a non-transaction session, the message sequence number is determined by the JMS IQ Manager when the JMS IQ Manager receives the message.

The minimum sequence number of a topic or queue is the sequence number of the first unconsumed message in the topic or queue. The maximum sequence number of a topic or a queue is the sequence number of the last unconsumed message in the topic or queue. Because all messages in the topic or the queue are sorted and indexed by sequence number, the first unconsumed message has the minimum sequence number, and the last unconsumed message has the maximum sequence number, among those residing in the topic or queue. If no unconsumed message exists in the topic or queue, the minimum sequence number and the maximum sequence number are identical and represent the next available sequence number. This number will be assigned to the next message received by the topic or queue.

The following example displays the current status of the queue PTP:


stcmsctrlutil -host localhost -port 24055 -queuestat PTP
Queue Name: PTP
First enqueue time: 03212005:08:33:09
Last enqueue time: 03212005:08:33:10
Number of current receivers: 2
Message count: 4
Messages sent and committed: 245
Min sequence number: 245
Max sequence number: 248
Suspended: No

In this example, four messages are in the queue PTP. The minimum sequence number is the sequence number of the first message, which is 245, and the maximum sequence number is the sequence number of the fourth message, which is 248. If all four currently resident messages are consumed, both the minimum and maximum sequence numbers will represent the next available sequence number, which is 249. This number will be assigned to the next incoming message.

In the initial state, where the JMS IQ Manager has not received or consumed any messages in the topic or queue, both the minimum and maximum sequence numbers are 0 (zero).