다음을 통해 공유


MSMQMessage.ResponseDestination

 

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

(Introduced in MSMQ 3.0.) The ResponseDestination property of the MSMQMessage object specifies a set of queues used for returning response messages.

Data type: MSMQDestination
Run-time access: Read/write
Property ResponseDestination As MSMQDestination  

Property Value

An MSMQDestination object that represents a distribution list, multicast address, or multiple-element format name (in C++, a smart pointer to the IMSMQDestination interface).

Remarks

The ResponseDestination property can be set by the sending application when requesting response messages from a receiving application. Response messages are application-defined, and it is the sending and receiving applications responsibility to understand what is in the message.

Response queues can be any transactional or nontransactional queue.

Sets of response queues can be specified using the following format names.

  • Distribution list format names are used to reference response queues based on a public distribution list that is published in the Active Directory Domain Services (AD DS). For information on the syntax of distribution list format names, see Distribution List Format Names.

  • Multicast address format names are used to reference response queues that are associated with a specific multicast address. For information on the syntax of multicast address format names, see Multicast Address Format Names.

  • Multiple-element format names are used to reference response queues based on a private list of destination queues. For information on the syntax of multiple element format names, see Multiple-Element Format Names.

In C++ COM applications, you must use a smart pointer to the IMSMQMessage3 interface to expose the ResponseDestination property.

Equivalent API Function Property

With API function calls, the equivalent property is PROPID_M_RESP_FORMAT_NAME.

Example Code

The following code fragments show how to set and retrieve the ResponseDestination property of a message as an MSMQDestination object that represents a distribution list.

To Set the ResponseDestination Property

Dim msg As New MSMQMessage  
Dim destResponse As New MSMQDestination  
destResponse.ADsPath = "LDAP://MyLdapServer/CN=MyDL,OU=MSMQDLs,DC=MyDomain,DC=MyCompany,DC=COM"  
Set msg.ResponseDestination = destResponse  

To Retrieve the ResponseDestination Property

Dim msg As MSMQMessage  
Dim destResponse As New MSMQDestination  
  
' TO DO: Read the message.  
  
Set destResponse = msg.ResponseDestination  

The following example is included in Using Message Queuing.

For an example of See
Specifying a set of queues for returning a response message Visual Basic Code Example: Returning Response Messages

Requirements

Windows NT/2000/XP: Included in Windows XP and Windows Server 2003.

Windows 95/98/Me: Unsupported.

Header: Declared in Mqoai.h.

Library: Use Mqoa.lib.

See Also

MSMQDestination
MSMQMessage
PROPID_M_RESP_FORMAT_NAME