3.1.7.1.32 Serialize Message to Buffer

The Serialize Message to Buffer event MUST be generated with the following input arguments:

Return Values:

  • None.

The queue manager MUST serialize iMessage to iBuffer according to the rules set in the following table. When serializing from a Message ADM element attribute (right column) to a UserMessage Packet field (left column), the UserMessage Packet fields on the left either MUST be set to the corresponding Message ADM element attributes on the right or MUST be computed as shown. After the message is serialized, the queue manager MUST set iBuffer.BaseHeader.PacketSize to the size, in bytes, of the entire UserMessage Packet structure referenced by iBuffer.

UserMessage Packet field

Message ADM element attribute

BaseHeader.Flags.PR

If the UserMessage Packet contains a TransactionHeader ([MS-MQMQ] section 2.2.20.5), this field MUST be set to 0x0, and the receiver MUST ignore it; otherwise, it MUST be set to the value of Message.Priority.

BaseHeader.Flags.TR

Message.TracingRequested

BaseHeader.Flags.DH

Message.TracingRequested

BaseHeader.TimeToReachQueue

Message.TimeToReachQueue

MessagePropertiesHeader.LabelLength

This field is the string length of Message.Label.

MessagePropertiesHeader.BodyType

Message.BodyType

MessagePropertiesHeader.MessageSize

This field MUST be set to the size in bytes of the length of Message.Body.

MessagePropertiesHeader.ExtensionSize

This field MUST be set to the size in bytes of the length of the Message.Extension.

MessagePropertiesHeader.EncryptionAlgorithm

Message.EncryptionAlgorithm

MessagePropertiesHeader.HashAlgorithm

Message.HashAlgorithm

MessagePropertiesHeader.ApplicationTag

Message.AppSpecific

MessagePropertiesHeader.CorrelationID

Message.CorrelationIdentifier

MessagePropertiesHeader.Flags

Message.AcknowledgementsRequested

MessagePropertiesHeader.MessageClass

Message.Class

MessagePropertiesHeader.ExtensionData

Message.Extension

MessagePropertiesHeader.Label

Message.Label

MessagePropertiesHeader.MessageBody

Message.Body

MessagePropertiesHeader.PrivacyLevel

Message.PrivacyLevel

SecurityHeader.Flags.AU

This field MUST be set to zero.

SecurityHeader.Flags.AS

This field MUST be set to zero.

SecurityHeader.Flags.EB

This field MUST be set to 1 if the Message.PrivacyLevel is not None; otherwise, it MUST be set to zero.

SecurityHeader.SenderCertSize

This field MUST be set to the size, in bytes, of the digital certificate signature in the Message.SenderCertificate.

SecurityHeader.ProviderInfoSize

This field MUST be set to the size, in bytes, of Message.AuthenticationProviderName plus 4 bytes.

SecurityHeader.Flags.DE

This field MUST be set to 0x1 when the signature is produced by the message queuing system as specified in [MS-MQMQ] section 2.2.20.6. It MUST be set to 0x0 when the signature is produced by the application with an alternative security provider.

SecurityHeader.SecurityData.ProviderInfo.ProviderType

Message.AuthenticationProviderType

SecurityHeader.SecurityData.ProviderInfo.ProviderName

Message.AuthenticationProviderName

SecurityHeader.Flags.ST

Message.SenderIdentifierType

SecurityHeader.SecurityData.Signature

Message.Signature

SecurityHeader.SecurityData.EncryptionKey

Message.SymmetricKey

SecurityHeader.SecurityData.SecurityID

Message.SenderIdentifier

SecurityHeader.SecurityData.SenderCert

Message.SenderCertificate

TransactionHeader.Flags.FA

Message.FinalAckRequired

TransactionHeader.Flags.ID

Message.TransactionIdentifier

TransactionHeader.TxSequenceNumber

Message.TransactionSequenceNumber

TransactionHeader.PreviousTxSequenceNumber

Message.TransactionPreviousSequenceNumber

TransactionHeader.TxSequenceID

Message.TransactionalMessageSequenceIdentifier

TransactionHeader.ConnectorQMGuid

Message.ConnectorQueueManagerIdentifier

TransactionHeader.Flags.FM

Message.FirstInTransaction

TransactionHeader.Flags.LM

Message.LastInTransaction

UserHeader.QueueManagerAddress

Message.DestinationQueueManagerIdentifier

UserHeader.ConnectorType

Message.ConnectorTypeIdentifier

UserHeader.SentTime

Message.SentTime

UserHeader.Flags.DQ

Message.DestinationQueueType

UserHeader.Flags.AQ

Message.AdministrationQueueType

UserHeader.Flags.RQ

Message.ResponseQueueType

UserHeader.TimeToBeReceived

Message.TimeToBeReceived

UserHeader.MessageID

Message.Identifier

UserHeader.SourceQueueManager

Message.SourceMachineIdentifier

UserHeader.AdminQueue

Message.AdministrationQueueFormatName

UserHeader.DestinationQueue

Message.DestinationQueueFormatName

UserHeader.Flags.DM

Message.DeliveryGuarantee

UserHeader.Flags.JP

PositiveJournalingRequested

UserHeader.Flags.JN

NegativeJournalingRequested

UserHeader.ResponseQueue

Message.ResponseQueueFormatName

MultiQueueFormatHeader.Destination

Message.DestinationMultiQueueFormatName

MultiQueueFormatHeader.Administration

Message.AdministrationMultiQueueFormatName

MultiQueueFormatHeader.Response

Message.ResponseMultiQueueFormatName

MultiQueueFormatHeader.Signature

Message.MultipleDestinationSignature

DebugHeader.Flags.QT

This field MUST be set to 1 if Message.TracingQueueIdentifier is set; otherwise, it MUST be set to zero.

DebugHeader.QueueIdentifier

Message.TracingQueueIdentifier

The following tables list the constant values corresponding to the listed enumerations. The MessagePropertiesHeader.MessageClass enumeration names are defined in [MS-MQMQ] section 2.2.18.1.6.

MessagePropertiesHeader.MessageClass

Message.Class

Constant Values

MQMSG_CLASS_NORMAL

Normal

0x0000

MQMSG_CLASS_REPORT

Report

0x0001

MQMSG_CLASS_ACK_REACH_QUEUE

AckReachQueue

0x0002

MQMSG_CLASS_ACK_RECEIVE

AckReceive

0x4000

MQMSG_CLASS_NACK_BAD_DST_Q

NackBadDestQueue

0x8000

MQMSG_CLASS_NACK_DELETED

NackPurged

0x8001

MQMSG_CLASS_NACK_REACH_QUEUE_TIMEOUT

NackReachQueueTimeout

0x8002

MQMSG_CLASS_NACK_Q_EXCEED_QUOTA

NackQueueExceedQuota

0x8003

MQMSG_CLASS_NACK_ACCESS_DENIED

NackAccessDenied

0x8004

MQMSG_CLASS_NACK_HOP_COUNT_EXCEEDED

NackHopCountExceeded

0x8005

MQMSG_CLASS_NACK_BAD_SIGNATURE

NackBadSignature

0x8006

MQMSG_CLASS_NACK_BAD_ENCRYPTION

NackBadEncryption

0x8007

MQMSG_CLASS_NACK_NOT_TRANSACTIONAL_Q

NackNotTransactionalQueue

0x8009

MQMSG_CLASS_NACK_NOT_TRANSACTIONAL_MSG

NackNotTransactionalMessage

0x800A

MQMSG_CLASS_NACK_UNSUPPORTED_CRYPTO_PROVIDER

NackUnsupportedCryptoProvider

0x800B

MQMSG_CLASS_NACK_Q_DELETED

NackQueueDeleted

0xC000

MQMSG_CLASS_NACK_Q_PURGED

NackQueuePurged

0xC001

MQMSG_CLASS_NACK_RECEIVE_TIMEOUT

NackReceiveTimeout

0xC002

MessagePropertiesHeader.PrivacyLevel

Message.PrivacyLevel

0x00000000

None

0x00000001

Base

0x00000003

Enhanced

0x00000005

Advanced

UserHeader.Flags.JP

PositiveJournalingRequested

1

True

0

False

UserHeader.Flags.JN

NegativeJournalingRequested

1

True

0

False

MessagePropertiesHeader.EncryptionAlgorithm

Message.EncryptionAlgorithm

0x00006602

RC2

0x00006801

RC4

0x00006610

AES256

0x0000660E

AES128

0x0000660F

AES192

MessagePropertiesHeader.HashAlgorithm

Message.HashAlgorithm

0x00008001

MD2

0x00008002

MD4

0x00008003

MD5

0x00008004

SHA1

0x0000800C

SHA_256

0x0000800E

SHA_512

QueueFormatType

Message.DestinationQueueType

0x3

PrivateQueue

0x5

PublicQueue

0x7

DirectQueue

QueueFormatType

Message.AdministrationQueueType

0x0

None

0x2

PrivateQueueOnSource

0x3

PrivateQueueOnDestination

0x5

PublicQueue

0x6

PrivateQueueOnOther

0x7

DirectQueue

QueueFormatType

Message.ResponseQueueType

0x0

None

0x1

SameAsAdministrationQueue

0x2

PrivateQueueOnSource

0x3

PrivateQueueOnDestination

0x4

PrivateQueueOnAdmin

0x5

PublicQueue

0x6

PrivateQueueOnOther

0x7

DirectQueue

SecurityHeader.Flags.ST

Message.SenderIdentifierType

0x0

None

0x1

Sid

0x2

QueueManagerIdentifier