This documentation is archived and is not being maintained.

Sending Messages to Disconnected Queues

There are two situations in which messages cannot readily be delivered to their queues: when the machine on which the queue resides is not available, or when the domain controller needed to route your message is not available. Message Queuing allows you to handle these situations so that if you are disconnected from the network or a necessary machine or controller is not available, you can continue to send messages. In these cases, the messages are temporarily stored on a queue on the local machine or a machine along the delivery route until the necessary resources are back online for delivery to be completed.

For example, suppose you have a central queue that records orders sent by your on-the-road sales force. The sales force works in disconnected mode much of the day, recording order information from customer sites, and dials in once a day to transfer all of this information to the central queue. Because messages can be sent to queues when the sender is disconnected, the sales force can send their messages immediately upon recording the customer's information, and the system caches those messages until the nightly call is placed.

Sending a message to a disconnected queue is almost identical to the process of sending a message to an available queue. You do not have to perform any special configuration in order for your component to store messages in a temporary queue when the queue to which you are sending is not available. There are two main differences to be aware of:

  • If the queue is unavailable but the domain controller is working, you must identify the queue you want to send to by the queue's format name, rather than the path name. When a queue is disconnected, the domain controller for the queue cannot resolve the path name correctly. For more information on format names, see Queue Reference Recommendations.
  • If you set a time-out interval on your message send operation, the time-out period will begin to count down as soon as the message is sent. This means that while the message sits on your local machine waiting for the queue to become available, the time-out period is active and the expiration time is approaching. If you want to use the time-out period, you must either set it to a large enough interval to allow for delivery or request negative acknowledgement for the message so you know if expiration has occurred. For more information on requesting acknowledgement when a message cannot be delivered, see Requesting Acknowledgement for Messages.

To send a message to a disconnected queue

  1. Create an instance of the MessageQueue component. For more information, see Creating MessageQueue Component Instances.
  2. Set the Path property for the component to the format name of the queue to which you want to send a message.
    Note   If you create the component from Server Explorer, this property will automatically refer to the path instead of the format name. To change to the format name, click the expansion icon next to the Path property. In the dialog box that appears, locate and select the queue your component references; then select Format Name in the Reference Queue By field and click OK.
  3. Send your message normally.

See Also

Sending and Serializing Messages | Requesting Acknowledgement for Messages | Default Message Properties | Sending Simple Messages | Sending Complex Messages | Creating MessageQueue Component Instances | Verifying Messages at Design Time

Show: