2.2.20.4 SessionHeader

The SessionHeader is used to acknowledge express and recoverable UserMessage Packets received by the message transfer protocols. This header is present in stand-alone SessionAck Packet as defined in [MS-MQQB] (section 2.2.6) and is optional in a UserMessage Packet.

 This header contains a session acknowledgment. For more details, see [MS-MQQB] sections 3.1.1.7, and 3.1.1.6.1.

 The set of UserMessage Packets sent on a session represent a message sequence. There is a local-to-remote and remote-to-local sequence. These message sequences exist for the lifetime of the session. The local and remote protocols MUST maintain counts of the UserMessage Packets sent and received. A message MUST be associated with a sequence number that corresponds to its position within the sequence. Sequence numbers MUST begin with 1 and MUST increment by 1 with each subsequent message. For example, the third message sent on a session has a sequence number of 3.

The protocols MUST also maintain a count of recoverable UserMessage Packets sent and associates recoverable sequence numbers with those messages. For example, the fifth recoverable message sent on a session has a sequence number of 5.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

AckSequenceNumber

RecoverableMsgAckSeqNumber

RecoverableMsgAckFlags

UserMsgSequenceNumber

RecoverableMsgSeqNumber

WindowSize

Reserved

AckSequenceNumber (2 bytes): A 16-bit unsigned integer that specifies a count of messages received. This field MUST be set to the count of UserMessage Packets received on this session. This field acknowledges all messages up to and including the specified sequence number. This field has a valid range from 0x0000 to 0xFFFF, inclusive.

RecoverableMsgAckSeqNumber (2 bytes): A 16-bit unsigned integer that specifies a recoverable message sequence number. This field MUST be set to the lowest unacknowledged recoverable message sequence number that has been persisted for reliable recovery. If no recoverable messages have been received by the receiver since the last SessionHeader was sent, this field MUST be set to 0. This field has a valid range from 0x0000 to 0xFFFF, inclusive.

RecoverableMsgAckFlags (4 bytes): A 32-bit unsigned integer bit field representing messages. This bit field represents up to 32 recoverable UserMessage Packets that are being acknowledged as written to disk. Bit 0 of this field represents the UserMessage Packet whose sequence number is specified in the RecoverableMsgAckSeqNumber field. A given bit k of this field represents a recoverable UserMessage Packet with a sequence number of RecoverableMsgAckSeqNumber + k. The corresponding bit for a UserMessage Packet that has been persisted for reliable recovery MUST be set in the bit field.

UserMsgSequenceNumber (2 bytes): A 16-bit unsigned integer that is the count of messages sent. This field SHOULD<14> be set to the count of UserMessage Packets sent on this session. When the UserMsgSequenceNumber is not set to the count of UserMessage Packets sent on a session, the user message is sent to the destination queue, and the session is closed by the receiver. This field has a valid range from 0x0000 to 0xFFFF, inclusive.

RecoverableMsgSeqNumber (2 bytes): A 16-bit unsigned integer that is the count of recoverable messages sent. This field MUST be set to the count of recoverable UserMessage Packets sent on this session. This value MUST be 0 if no recoverable UserMessage Packets have been sent. This field has a valid range from 0x0000 to 0xFFFF, inclusive.

WindowSize (2 bytes): A 16-bit unsigned integer field that specifies the acknowledgment window size. The window size controls the frequency at which the message transfer protocols send acknowledgment packets.<15> The value of this field SHOULD be set to 0x0040.<16> This field has a valid range from 0x0001 to 0xFFFF, inclusive.<17>

Reserved (2 bytes): Reserved. Can be set to any arbitrary value when sent and MUST be ignored on receipt.