[MS-MQQP]: Message Queuing (MSMQ): Queue Manager To Queue . - Microsoft

Transcription

[MS-MQQP]:Message Queuing (MSMQ): Queue Manager to QueueManager ProtocolIntellectual Property Rights Notice for Open Specifications Documentation Technical Documentation. Microsoft publishes Open Specifications documentation (“thisdocumentation”) for protocols, file formats, data portability, computer languages, and standardssupport. Additionally, overview documents cover inter-protocol relationships and interactions.Copyrights. This documentation is covered by Microsoft copyrights. Regardless of any otherterms that are contained in the terms of use for the Microsoft website that hosts thisdocumentation, you can make copies of it in order to develop implementations of the technologiesthat are described in this documentation and can distribute portions of it in your implementationsthat use these technologies or in your documentation as necessary to properly document theimplementation. You can also distribute in your implementation, with or without modification, anyschemas, IDLs, or code samples that are included in the documentation. This permission alsoapplies to any documents that are referenced in the Open Specifications documentation.No Trade Secrets. Microsoft does not claim any trade secret rights in this documentation.Patents. Microsoft has patents that might cover your implementations of the technologiesdescribed in the Open Specifications documentation. Neither this notice nor Microsoft's delivery ofthis documentation grants any licenses under those patents or any other Microsoft patents.However, a given Open Specifications document might be covered by the Microsoft OpenSpecifications Promise or the Microsoft Community Promise. If you would prefer a written license,or if the technologies described in this documentation are not covered by the Open SpecificationsPromise or Community Promise, as applicable, patent licenses are available by contactingiplg@microsoft.com.License Programs. To see all of the protocols in scope under a specific license program and theassociated patents, visit the Patent Map.Trademarks. The names of companies and products contained in this documentation might becovered by trademarks or similar intellectual property rights. This notice does not grant anylicenses under those rights. For a list of Microsoft trademarks, visitwww.microsoft.com/trademarks.Fictitious Names. The example companies, organizations, products, domain names, emailaddresses, logos, people, places, and events that are depicted in this documentation are fictitious.No association with any real company, organization, product, domain name, email address, logo,person, place, or event is intended or should be inferred.Reservation of Rights. All other rights are reserved, and this notice does not grant any rights otherthan as specifically described above, whether by implication, estoppel, or otherwise.Tools. The Open Specifications documentation does not require the use of Microsoft programmingtools or programming environments in order for you to develop an implementation. If you have accessto Microsoft programming tools and environments, you are free to take advantage of them. CertainOpen Specifications documents are intended for use in conjunction with publicly available standardsspecifications and network programming art and, as such, assume that the reader either is familiarwith the aforementioned material or has immediate access to it.Support. For questions and support, please contact dochelp@microsoft.com.1 / 60[MS-MQQP] - v20210625Message Queuing (MSMQ): Queue Manager to Queue Manager ProtocolCopyright 2021 Microsoft CorporationRelease: June 25, 2021

Revision 1/20070.1NewVersion 0.1 release8/10/20071.0MajorUpdated and revised the technical content.9/28/20071.0.1EditorialChanged language and formatting in the technical content.10/23/20071.0.2EditorialChanged language and formatting in the technical content.11/30/20071.0.3EditorialChanged language and formatting in the technical content.1/25/20081.0.4EditorialChanged language and formatting in the technical content.3/14/20081.0.5EditorialChanged language and formatting in the technical content.5/16/20081.0.6EditorialChanged language and formatting in the technical content.6/20/20081.0.7EditorialChanged language and formatting in the technical content.7/25/20081.0.8EditorialChanged language and formatting in the technical content.8/29/20082.0MajorUpdated and revised the technical content.10/24/20083.0MajorUpdated and revised the technical content.12/5/20084.0MajorUpdated and revised the technical content.1/16/20094.1MinorClarified the meaning of the technical content.2/27/20094.2MinorClarified the meaning of the technical content.4/10/20094.2.1EditorialChanged language and formatting in the technical content.5/22/20094.2.2EditorialChanged language and formatting in the technical content.7/2/20095.0MajorUpdated and revised the technical content.8/14/20096.0MajorUpdated and revised the technical content.9/25/20097.0MajorUpdated and revised the technical content.11/6/20098.0MajorUpdated and revised the technical content.12/18/20099.0MajorUpdated and revised the technical content.1/29/201010.0MajorUpdated and revised the technical content.3/12/201010.0.1EditorialChanged language and formatting in the technical content.4/23/201010.0.2EditorialChanged language and formatting in the technical content.6/4/201011.0MajorUpdated and revised the technical content.7/16/201011.0NoneNo changes to the meaning, language, or formatting of thetechnical content.8/27/201012.0MajorUpdated and revised the technical content.10/8/201013.0MajorUpdated and revised the technical content.11/19/201013.0NoneNo changes to the meaning, language, or formatting of the2 / 60[MS-MQQP] - v20210625Message Queuing (MSMQ): Queue Manager to Queue Manager ProtocolCopyright 2021 Microsoft CorporationRelease: June 25, 2021

DateRevisionHistoryRevisionClassCommentstechnical content.1/7/201113.0NoneNo changes to the meaning, language, or formatting of thetechnical content.2/11/201114.0MajorUpdated and revised the technical content.3/25/201115.0MajorUpdated and revised the technical content.5/6/201116.0MajorUpdated and revised the technical content.6/17/201116.1MinorClarified the meaning of the technical content.9/23/201116.1NoneNo changes to the meaning, language, or formatting of thetechnical content.12/16/201117.0MajorUpdated and revised the technical content.3/30/201217.0NoneNo changes to the meaning, language, or formatting of thetechnical content.7/12/201217.1MinorClarified the meaning of the technical content.10/25/201218.0MajorUpdated and revised the technical content.1/31/201318.0NoneNo changes to the meaning, language, or formatting of thetechnical content.8/8/201319.0MajorUpdated and revised the technical content.11/14/201319.0NoneNo changes to the meaning, language, or formatting of thetechnical content.2/13/201419.0NoneNo changes to the meaning, language, or formatting of thetechnical content.5/15/201419.0NoneNo changes to the meaning, language, or formatting of thetechnical content.6/30/201520.0MajorSignificantly changed the technical content.10/16/201520.0NoneNo changes to the meaning, language, or formatting of thetechnical content.7/14/201620.0NoneNo changes to the meaning, language, or formatting of thetechnical content.6/1/201720.0NoneNo changes to the meaning, language, or formatting of thetechnical content.9/15/201721.0MajorSignificantly changed the technical content.9/12/201822.0MajorSignificantly changed the technical content.4/7/202123.0MajorSignificantly changed the technical content.6/25/202124.0MajorSignificantly changed the technical content.3 / 60[MS-MQQP] - v20210625Message Queuing (MSMQ): Queue Manager to Queue Manager ProtocolCopyright 2021 Microsoft CorporationRelease: June 25, 2021

Table of Contents1Introduction . 61.1Glossary . 61.2References . 71.2.1Normative References . 81.2.2Informative References . 81.3Overview . 81.3.1Messages. 91.3.2Queues. 91.3.3Queue Operations . 91.3.4Access Patterns . 101.4Relationship to Other Protocols . 101.5Prerequisites/Preconditions . 111.6Applicability Statement . 111.7Versioning and Capability Negotiation . 111.8Vendor-Extensible Fields . 121.9Standards Assignments. 122Messages . 132.1Transport . 132.2Common Data Types . 132.2.1Data Types . 142.2.1.1PCTX RRSESSION HANDLE TYPE . 142.2.1.2PCTX REMOTEREAD HANDLE TYPE . 142.2.1.3REMOTEREADACK . 142.2.2Structures . 142.2.2.1REMOTEREADDESC . 142.2.2.2REMOTEREADDESC2 . 162.3Directory Service Schema Elements . 163Protocol Details . 173.1qm2qm Server Details . 173.1.1Abstract Data Model . 173.1.1.1Shared Data Elements . 173.1.1.2RemoteReadEntry . 173.1.1.3RemoteReadEntryCollection . 183.1.1.4OpenQueueEntry. 183.1.1.5OpenQueueEntryCollection . 183.1.2Timers . 183.1.3Initialization . 183.1.4Message Processing Events and Sequencing Rules . 183.1.4.1RemoteQMStartReceive (Opnum 0) . 193.1.4.2RemoteQMEndReceive (Opnum 1) . 223.1.4.3RemoteQMOpenQueue (Opnum 2) . 243.1.4.4RemoteQMCloseQueue (Opnum 3) . 253.1.4.5RemoteQMCloseCursor (Opnum 4) . 263.1.4.6RemoteQMCancelReceive (Opnum 5) . 273.1.4.7RemoteQMPurgeQueue (Opnum 6) . 283.1.4.8RemoteQMGetQMQMServerPort (Opnum 7) . 293.1.4.9RemoteQmGetVersion (Opnum 8) . 303.1.4.10RemoteQMStartReceive2 (Opnum 9) . 303.1.4.11RemoteQMStartReceiveByLookupId (Opnum 10) . 333.1.5Timer Events . 363.1.6Other Local Events . 373.1.6.1PCTX RRSESSION HANDLE TYPE Rundown . 373.1.6.2PCTX REMOTEREAD HANDLE TYPE Rundown . 374 / 60[MS-MQQP] - v20210625Message Queuing (MSMQ): Queue Manager to Queue Manager ProtocolCopyright 2021 Microsoft CorporationRelease: June 25, 2021

3.2qm2qm Client Details . 373.2.1Abstract Data Model . 373.2.1.1PendingRemoteReadEntry . 373.2.1.2PendingRemoteReadEntryCollection. 373.2.1.3RemoteOpenQueueEntry . 383.2.1.4RemoteOpenQueueEntryCollection . 383.2.2Timers . 383.2.3Initialization . 383.2.4Message Processing Events and Sequencing Rules . 383.2.4.1Opening a Queue . 383.2.4.2Peeking a Message . 393.2.4.3Receiving a Message . 413.2.4.4Purging a Queue . 423.2.4.5Peeking a Message by Using a Cursor . 433.2.4.6Receiving a Message by Using a Cursor. 443.2.4.7Canceling a Pending Peek or Receive . 463.2.4.8Closing a Cursor . 463.2.4.9Closing a Queue . 463.2.5Timer Events . 473.2.6Other Local Events . 474Protocol Examples . 484.1Receive Example . 484.2Purge Example. 495Security . 505.1Security Considerations for Implementers . 505.2Index of Security Parameters . 506Appendix A: Full IDL . 517Appendix B: Product Behavior . 538Change Tracking . 579Index . 585 / 60[MS-MQQP] - v20210625Message Queuing (MSMQ): Queue Manager to Queue Manager ProtocolCopyright 2021 Microsoft CorporationRelease: June 25, 2021

1IntroductionThis document specifies the Message Queuing (MSMQ): Queue Manager to Queue Manager Protocol.The Queue Manager to Queue Manager Protocol is an RPC-based protocol used by the queuemanager and runtime library to read and purge messages from a remote queue.Sections 1.5, 1.8, 1.9, 2, and 3 of this specification are normative. All other sections and examples inthis specification are informative.1.1GlossaryThis document uses the following terms:authentication level: A numeric value indicating the level of authentication or message protectionthat remote procedure call (RPC) will apply to a specific message exchange. For moreinformation, see [C706] section 13.1.2.1 and [MS-RPCE].cursor: A data structure providing sequential access over a message queue. A cursor has a currentpointer that lies between the head and tail pointer of the queue. The pointer can be movedforward or backward through an operation on the cursor (Next). A message at the currentpointer can be accessed through a nondestructive read (Peek) operation or a destructive read(Receive) operation.dynamic endpoint: A network-specific server address that is requested and assigned at run time.For more information, see [C706].endpoint: A network-specific address of a remote procedure call (RPC) server process for remoteprocedure calls. The actual name and type of the endpoint depends on the RPC protocolsequence that is being used. For example, for RPC over TCP (RPC Protocol Sequencencacn ip tcp), an endpoint might be TCP port 1025. For RPC over Server Message Block (RPCProtocol Sequence ncacn np), an endpoint might be the name of a named pipe. For moreinformation, see [C706].globally unique identifier (GUID): A term used interchangeably with universally uniqueidentifier (UUID) in Microsoft protocol technical documents (TDs). Interchanging the usage ofthese terms does not imply or require a specific algorithm or mechanism to generate the value.Specifically, the use of this term does not imply or require that the algorithms described in[RFC4122] or [C706] must be used for generating the GUID. See also universally uniqueidentifier (UUID).Interface Definition Language (IDL): The International Standards Organization (ISO) standardlanguage for specifying the interface for remote procedure calls. For more information, see[C706] section 4.message: A data structure representing a unit of data transfer between distributed applications. Amessage has message properties, which may include message header properties, a messagebody property, and message trailer properties.message body: A distinguished message property that represents the application payload.message header: See message packet header.message property: A data structure that contains a property identifier and a value, and that isassociated with a message.message queuing: A communications service that provides asynchronous and reliable messagepassing between distributed client applications. In message queuing, clients send messages tomessage queues and consume messages from message queues. The message queues provide6 / 60[MS-MQQP] - v20210625Message Queuing (MSMQ): Queue Manager to Queue Manager ProtocolCopyright 2021 Microsoft CorporationRelease: June 25, 2021

persistence of the messages, which enables the sending and receiving client applications tooperate asynchronously from each other.message trailer: See message packet trailer.Microsoft Message Queuing (MSMQ): A communications service that provides asynchronousand reliable message passing between distributed applications. In Message Queuing,applications send messages to queues and consume messages from queues. The queuesprovide persistence of the messages, enabling the sending and receiving applications tooperate asynchronously from one another.MQMP application: An application that communicates with an MSMQ supporting server using the[MS-MQMP] protocol.Network Data Representation (NDR): A specification that defines a mapping from InterfaceDefinition Language (IDL) data types onto octet streams. NDR also refers to the runtimeenvironment that implements the mapping facilities (for example, data provided to NDR). Formore information, see [MS-RPCE] and [C706] section 14.purge: In the context of a queue, to delete all messages from the queue.queue: An object that holds messages passed between applications or messages passedbetween Message Queuing and applications. In general, applications can send messages toqueues and read messages from queues.queue manager (QM): A message queuing service that manages queues deployed on acomputer. A queue manager can also provide asynchronous transfer of messages to queuesdeployed on other queue managers.remote procedure call (RPC): A communication protocol used primarily between client andserver. The term has three definitions that are often used interchangeably: a runtimeenvironment providing for communication facilities between computers (the RPC runtime); a setof request-and-response message exchanges between computers (the RPC exchange); and thesingle message from an RPC exchange (the RPC message). For more information, see [C706].remote queue: For a queue manager, a queue that is hosted by a remote queue manager.For an application, a queue hosted by a queue manager other than the one with which theapplication communicates.remote read: The act of reading (receiving) messages from a remote queue.universally unique identifier (UUID): A 128-bit value. UUIDs can be used for multiplepurposes, from tagging objects with an extremely short lifetime, to reliably identifying verypersistent objects in cross-process communication such as client and server interfaces, managerentry-point vectors, and RPC objects. UUIDs are highly likely to be unique. UUIDs are alsoknown as globally unique identifiers (GUIDs) and these terms are used interchangeably inthe Microsoft protocol technical documents (TDs). Interchanging the usage of these terms doesnot imply or require a specific algorithm or mechanism to generate the UUID. Specifically, theuse of this term does not imply or require that the algorithms described in [RFC4122] or [C706]must be used for generating the UUID.MAY, SHOULD, MUST, SHOULD NOT, MUST NOT: These terms (in all caps) are used as definedin [RFC2119]. All statements of optional behavior use either MAY, SHOULD, or SHOULD NOT.1.2ReferencesLinks to a document in the Microsoft Open Specifications library point to the correct section in themost recently published version of the referenced document. However, because individual documents7 / 60[MS-MQQP] - v20210625Message Queuing (MSMQ): Queue Manager to Queue Manager ProtocolCopyright 2021 Microsoft CorporationRelease: June 25, 2021

in the library are not updated at the same time, the section numbers in the documents may notmatch. You can confirm the correct section numbering by checking the Errata.1.2.1 Normative ReferencesWe conduct frequent surveys of the normative references to assure their continued availability. If youhave any issue with finding a normative reference, please contact dochelp@microsoft.com. We willassist you in finding the relevant information.[C706] The Open Group, "DCE 1.1: Remote Procedure Call", C706, August 1997,https://publications.opengroup.org/c706Note Registration is required to download the document.[MC-MQAC] Microsoft Corporation, "Message Queuing (MSMQ): ActiveX Client Protocol".[MS-ADTS] Microsoft Corporation, "Active Directory Technical Specification".[MS-DTYP] Microsoft Corporation, "Windows Data Types".[MS-ERREF] Microsoft Corporation, "Windows Error Codes".[MS-MQDMPR] Microsoft Corporation, "Message Queuing (MSMQ): Common Data Model andProcessing Rules".[MS-MQDSSM] Microsoft Corporation, "Message Queuing (MSMQ): Directory Service SchemaMapping".[MS-MQDS] Microsoft Corporation, "Message Queuing (MSMQ): Directory Service Protocol".[MS-MQMP] Microsoft Corporation, "Message Queuing (MSMQ): Queue Manager Client Protocol".[MS-MQMQ] Microsoft Corporation, "Message Queuing (MSMQ): Data Structures".[MS-MQRR] Microsoft Corporation, "Message Queuing (MSMQ): Queue Manager Remote ReadProtocol".[MS-RPCE] Microsoft Corporation, "Remote Procedure Call Protocol Extensions".[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC2119, March 1997, http://www.rfc-editor.org/rfc/rfc2119.txt1.2.2 Informative References[MS-MQOD] Microsoft Corporation, "Message Queuing Protocols Overview".1.3OverviewMessage queuing is a communications service that provides asynchronous and reliable messagepassing between client applications, including those client applications running on different hosts. Inmessage queuing, clients send messages to a queue and consume application messages from aqueue. The queue provides persistence of the messages, enabling them to survive across applicationrestarts, and allowing the sending and receiving client applications to operate asynchronously fromeach other.Queues are typically hosted by a communications service called a queue manager. By hosting thequeue manager in a separate service from the client applications, applications can communicate by8 / 60[MS-MQQP] - v20210625Message Queuing (MSMQ): Queue Manager to Queue Manager ProtocolCopyright 2021 Microsoft CorporationRelease: June 25, 2021

exchanging messages via a queue hosted by the queue manager, even if the client applications neverexecute at the same time.The queue manager can perform operations on a remote queue. When this scenario occurs, aprotocol is required to insert messages into the remote queue, and another protocol is required toconsume messages from the remote queue. The Message Queuing (MSMQ): Queue Manager to QueueManager Protocol provides a protocol for consuming messages from a remote queue.The Queue Manager to Queue Manager Protocol is used only to read messages from a queue or topurge messages from the queue. Reading a message also implies deleting the message after it isread, as specified in Queue Operations (section 1.3.3).1.3.1 MessagesEach message that is exchanged in a message queuing system typically has a set of messageproperties that contain metadata about the message and a distinguished property, called a messagebody, that contains the application payload.Message properties that are serialized in front of the message body are referred to as messageheaders, and message properties that are serialized after the message body property are referred toas message trailers.Messages that are carried by this protocol are treated as payload. The format and structure of theapplication messages are opaque to the protocol.The protocol also requires that each message have a lookup identifier that is unique in the queue.This identifier is not part of the message but is instead assigned by the server.1.3.2 QueuesA queue is a logical data structure containing an ordered first-in-first-out (FIFO) list of zero or moremessages.This protocol provides a mechanism to open a queue. Opening provides an opportunity to check forthe existence of the queue and to perform authorization checks. The protocol provides for the returnof an RPC context handle that is used by the client to specify the queue to operate on in subsequentrequests. The use of an RPC context handle provides a mechanism to ensure that server state iscleaned up if the connection between the client and server is lost.When opening a queue, the client can specify an access mode that determines the operations (Peek,Receive, CancelReceive, and Purge) for which the returned handle can subsequently be used. Theclient can specify a sharing mode that either allows other clients to access the queue concurrently orensures that the client has exclusive access to the queue. The exclusive access sharing mode can beused to avoid race conditions caused by other clients operating on the queue at the same time. Thissharing mode is specified when opening a remote queue, as specified in [MS-MQMP] section 3.1.4.2.1.3.3 Queue OperationsThe protocol provides mechanisms for the following operations against an open queue.A message can be consumed from an open queue through a destructive read operation referred to asReceive. This operation atomically reads the message and removes it from the queue. Since thisoperation removes a message from a queue, losing a network connection during this operation couldresult in permanent loss of the message.To guard against this situation, the protocol provides a mechanism for the client to either positively ornegatively acknowledge receipt of the message. On receipt of positive acknowledgment from the9 / 60[MS-MQQP] - v20210625Message Queuing (MSMQ): Queue Manager to Queue Manager ProtocolCopyright 2021 Microsoft CorporationRelease: June 25, 2021

client, the server can remove the message from th

described in the Open Specifications documentation. Neither this notice nor Microsoft's delivery of this documentation grants any licenses under those patents or any other Microsoft patents. However, a given Open Specifications document might be covered by the Microsoft Open Specifications Promise or the Microsoft Community Promise.