3.1.1.3.1 Session State

The sender and receiver MUST independently maintain the following ADM elements for each session.

RemoteQMGuid: The GUID ([MS-DTYP] section 2.3.4) of the remote queue manager. This value represents the destination queue manager if a direct connection is possible or the next hop if routing is required. This value uniquely identifies the remote host.<34>

NextHopCollection: A list of the possible next hops that can be used to create a session to the destination queue manager.

NextHopIndexer: A reference to the current item in the NextHopCollection ADM element that is used to try to establish a protocol session.

RemoteQMPublicKey: An MQDSPUBLICKEYS ([MS-MQMQ] section 2.2.2) structure that contains the public encryption keys of the remote queue manager.

MessageSentCount: A 16-bit unsigned integer that is the count of all UserMessage Packets ([MS-MQMQ] section 2.2.20) sent on a session. This value is incremented by 1 for each express, recoverable, and transacted UserMessage Packet sent.

RecoverableMessageSentCount: A 16-bit unsigned integer that is the count of recoverable UserMessage Packets sent on a session. This value is incremented by 1 for each recoverable message sent.

MessageReceivedCount: A 16-bit unsigned integer that is the count of all UserMessage Packets received on a session.

RecoverableMessageReceivedCount: A 16-bit unsigned integer that is the count of recoverable UserMessage Packets received on a session.

LastAckedRecoverableMsgSeqNumber: A 16-bit unsigned integer that is the sequence number of the last recoverable UserMessage Packet acknowledged by the last SessionAck Packet (section 2.2.6).

RecoverableMsgAckFlags: A 32-bit unsigned integer, as specified in [MS-MQMQ] section 2.2.20.4, representing up to 32 recoverable UserMessage Packets that are acknowledged as written to disk.

UnackedReceivedMsgCount: A 16-bit unsigned integer that is the count of UserMessage Packets received on a session that have not been acknowledged.

OutgoingTxSequenceID: A TxSequenceID ([MS-MQMQ] section 2.2.18.1.2) structure that identifies the current outgoing sequence of transactional messages. Only one sequence is valid at a given time. When updating this value, the queue manager MUST guarantee that the new value is greater than any previously assigned value. This requirement allows the unique identification of an outgoing sequence of transactional messages. The value of OutgoingTxSequenceID.Ordinal MUST be set to 0x00000001, and the value of OutgoingTxSequenceID.Timestamp MUST be set to an implementation-dependent<35> value that is guaranteed to be greater than any previously generated value. This value MUST survive process and node failures.

TxMessageRejectCount: Identifies the number of times that the last Message ([MS-MQDMPR] section 3.1.1.12) ADM element instance sent by the remote queue manager was rejected before finally being accepted and placed in the localĀ  Queue ([MS-MQDMPR] section 3.1.1.2) ADM element instance. This value MUST be initialized to 0x00000000 and MUST survive process and node failures.

OutgoingTxSequenceNumber: A 32-bit unsigned integer. This ADM element is the sequence number of the next outgoing transactional UserMessage Packet to be sent on a session. This value MUST be initialized to 0x00000001 and MUST survive process and node failures.

IncomingTxSequenceID: A TxSequenceID ([MS-MQMQ] section 2.2.18.1.2) structure that identifies the last incoming transactional messages sequence on a session. An IncomingTxSequenceID.Ordinal value of 0x00000000 indicates that no transactional sequence has existed on a session. The value of IncomingTxSequenceID.Ordinal MUST be initialized to 0x00000000, and the value of IncomingTxSequenceID.Timestamp MUST be initialized to 0x00000000. This value MUST survive process and node failures.

IncomingTxSequenceNumber: A 32-bit unsigned integer that identifies the sequence number of the last transactional UserMessage Packet received on a session. This value MUST be initialized to 0x00000000 and MUST survive process and node failures.

OutgoingQueueReference: A reference to the OutgoingQueue ([MS-MQDMPR] section 3.1.1.3) ADM element instance associated with the session. This value MUST survive process and node failures, and the default value is NULL.

TxOutgoingSequence: A reference to an OutgoingTransferSequence (section 3.1.1.3.1.1) ADM element instance.

WindowSize: This ADM element represents the session acknowledgment window size.<36> The window size controls when the protocol sends session acknowledgments for received messages and sets a limit on the number of unacknowledged outgoing messages.

ReceivedWindowSize: This ADM element represents the session acknowledgment window size of the other queue manager participating in the session. For the local queue manager, the ReceivedWindowSize ADM element represents the WindowSize ADM element of the destination queue manager. For the destination queue manager, the ReceivedWindowSize ADM element represents the WindowSize ADM element of the local queue manager.

SessionState: A value that indicates the current state of the protocol. Valid values are as follows.

Value

Meaning

OPEN

The protocol has completed session initialization.

CLOSED

Indicates that the session is closed.

WAITING_CP_MSG

The protocol is waiting for a ConnectionParameters Packet.

WAITING_CPR_MSG

The protocol is waiting for a ConnectionParameters Packet response packet.

WAITING_EC_MSG

The protocol is waiting for an EstablishConnection Packet.

WAITING_ECR_MSG

The protocol is waiting for an EstablishConnection Packet response packet.

WAITING_RECONNECT

The protocol is waiting for the Session Retry Connect Timer Event (section 3.1.6.1).

SessionActive: A Boolean value that is set to TRUE when there is activity on the session. This value is used by the Session Cleanup Timer (section 3.1.2.2) to identify when there has been message activity since the last Session Cleanup Timer Event (section 3.1.6.2).

ReceivedAck: A Boolean value that is set to TRUE when there is activity on the session. This value is used by the Session Ack Wait Timer (section 3.1.2.4) to identify when there has been message activity since the last Session Ack Wait Timer Event (section 3.1.6.3).

AckWaitTimeout: Time, in milliseconds, that the protocol waits before closing the session because its messages are not acknowledged.

RecoverableAckSendTimeout: Time, in milliseconds, that the protocol waits before transmitting a session acknowledgment.

RemoteQMAddress: The address of the remote queue manager. This value MUST be a textual IPv4, IPv6, or SPX address.

RemoteQMHostName: A string representing the name of the destination host.

UnAckedMessageCount: The count of sent UserMessage Packets that have not been acknowledged by the remote queue manager.

OutgoingMessageTable: An ordered list of OutgoingMessagePosition ADM element instances. This table contains unsent messages and/or messages awaiting acknowledgment. The messages are listed in the order in which they are added to the list. This table MUST be initialized to an empty table and MUST survive process and node failures by saving each OutgoingMessagePosition ADM element instance containing recoverable or transactional messages in the order in which it is listed.

AwaitingFinalACKTable: A list of OutgoingMessagePosition ADM element instances. This table contains a list of messages that have been successfully delivered but that are awaiting final acknowledgment. Messages in this table have UserMessage.UserHeader.Flags.JN or UserMessage.UserHeader.Flags.JP bit fields set to values other than 0. This value MUST be initialized to an empty list and MUST survive process and node failures.

DirectFormatSession: A Boolean value that is set to TRUE when transactional messages are sent with a direct queue format name. This value is used to populate the sender order queue when an OrderAck Packet (section 2.2.4) or a FinalAck Packet (section 2.2.5) is sent from the receiver to the sender.

OrderAckTimeout: Time, in milliseconds, that the protocol waits before transmitting an order acknowledgment.

LastOrderAckSendTime: The time when the last order acknowledgment was sent to the sender. This value is the number of seconds elapsed since midnight (00:00:00), January 1, 1970 (UTC) according to the system clock.

MaximumOrderAckDelay: The maximum time, in seconds, that the protocol allows to lapse since LastOrderAckSendTime when determining whether to delay the transmission of an order acknowledgment.

Note The values of the OutgoingTxSequenceID, OutgoingTxSequenceNumber, IncomingTxSequenceID, TxMessageRejectCount, and IncomingTxSequenceNumber ADM elements apply only to transactional messages that originate from this host or are addressed to a final destination queue on this host. Transactional messages forwarded through this host are not processed as part of the incoming or outgoing transactional sequence.

The preceding conceptual data can be implemented by using a variety of techniques.