Storing messages

Most queue types hold messages in a persistent store. While in the store, the state of the message varies as it is transferred into and out of the store. As shown in Figure 7:

Figure 7. Stored message state flow

Diagram showing stored message status flow

Message states

The possible message states are:

Start
The initial state of a message before it is added to the message store.

Put Unconfirmed
A message has been placed in the message store under a confirmID but its addition has not been confirmed. The message is effectively hidden from all actions except confirmPutMessage, confirm, or undo.

Unlocked
A message has been added to the message store. There is no lock on it, and it is visible to all queries.

Locked for Browse
A browse with lock has retrieved the message. The message is now hidden from all queries except getMessage, unlockMessage, and undo.

Get Unconfirmed
A get message has been made with a confirmID but the get has not been confirmed. The message is invisible to all queries except confirmGetMessage, confirm, or undo. Each of these actions requires the matching confirmID to be included to confirm the get.

Browse Get Unconfirmed
A message has been got while it is locked for browse. This can only be done by passing the correct lockID to the getMessage function.

Deleted
The final state, after a message has been removed from the database.

Message events

Messages pass from one state to another as a result of an event. The possible message events (as shown in Figure 7) are:

putMessage
Message placed on message store, no confirm required.

getMessage
Message retrieved from message store, no confirm required.

putMessage with confirmId>0
Message placed on message store, confirm required.

confirmPutMessage
A confirm for an earlier putMessage with confirmId>0.

getMessage with confirmId>0
Message retrieved from message store, confirm required.

confirmGetMessage
A confirm for an earlier getMessage with confirmId>0.

browseWithLock
Browse messages and lock those that match. Prevents messages changing while browse is in operation.

unlockMessage
Unlock a message locked with a browsewithLock command.

undo
Unlock a message locked with a browse, or undo a getMessage with confirmId>0 or putMessage with confirmId>0.

deleteMessage
Remove a message from the message store.

More detailed descriptions of message events and states are included in Assured message delivery, and Browse and Lock and

Message index fields

Due to memory size constraints, complete messages are not held in memory, but, to enable faster message searching, WebSphere MQ Everyplace holds specific fields from each message in a message index. The fields that are held in the index are:

Unique ID
MQE_MSG_ORIGIN_QMGR + MQE_MSG_TIME

Message ID
MQE_MSG_MSGID

Correlation ID
MQE_MSG_CORRELID

Priority
MQE_MSG_PRIORITY

Providing these fields in a filter makes searching more efficient, since WebSphere MQ Everyplace may not have to load all the available messages into memory.



© IBM Corporation 2000, 2003. All Rights Reserved