共用方式為


Public Format Names

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

Public format names are used to reference public queues. They are used to perform the following operations:

  • To open a public queue to send messages and request routing. A public queue can be opened with a public or direct format name. When a public format name is used, Message Queuing uses its internal routing algorithm to define the route to the destination queue. When a direct format name is used, the message is sent directly to the queue.

  • To open a public queue to read messages.

  • To retrieve and set the properties of a public queue.

  • To retrieve or set the security descriptor of a public queue.

When the queue manager detects a public format name, it looks in the directory service to determine what computer is currently hosting the queue, what protocol the host computer uses, and any other information that it needs to route the message to the queue. Public format names cannot be used on computers operating in workgroup mode.

Public Format Name Syntax

Public format names contain the string "PUBLIC=" followed by the identifier (GUID) of the queue that is generated by Message Queuing when the queue is created. The following is the general form of the public format names used to reference a public queue and its associated queue journal:

PUBLIC=QueueGUID                  *Public queues.  
PUBLIC=QueueGUID;JOURNAL          *Public queue journals.  

A public format name is strictly equivalent to the identifier of the queue (see PROPID_Q_INSTANCE or MSMQQueueInfo.QueueGuid) except that a public format name is formatted as a string rather than as binary data. The following line of code is an example of a public format name string (note that the format name string is a null-terminated Unicode string).

LPWSTR wsz = L"PUBLIC=308FB580-1EB2-11CA-923B-08002B1075A7";  

Specifying Multiple Queues

Public format names can also be used to reference a public queue in distribution lists and multiple-element format names. Distribution lists and multiple-element format names can be used to send messages to multiple destinations and specify multiple response queues.

Location Independence

The location of a public queue (the specific computer where the messages belonging to the queue are stored) is not part of the public format name. This allows message operations to succeed when using public format names regardless of whether the location of the queue is known to the caller.

For information on See
Ways to obtain a format name Obtaining Format Names
The elements and syntax of private format names Private Format Names
The elements and syntax of distribution list format names Distribution List Format Names
The elements and syntax of multiple-element format names Multiple-Element Format Names
The elements and syntax of direct format names Direct Format Names
The elements and syntax of machine and connector format names for computer journals, dead-letter queues, and connector queues Machine and Connector Format Names