Partager via


Move Messages

Applies To: Windows Server 2008

Use this procedure to move messages.

Messages may be moved from a parent queue to a subqueue, between subqueues within a queue, or from a subqueue to its parent queue. Messages may not, however, be moved between different parent queues, or to subqueues of different parent queues.

If the main queue is transactional, moving messages between subqueues or between the main queue and a subqueue can be performed as part of a transaction. If the main queue is nontransactional, moving messages between subqueues or between the main queue and a subqueue should not be performed as part of a transaction. In this scenario, messages might be lost if the transactions fail.

The format for the path of the target queue must be specified as follows.

Queue type Path format

Public queue

Host Name\Queue Name;Subqueue Name

For example:

ITComputer\Orders;RejectedOrders

Private queue

Host Name\private$\Queue Name;Subqueue Name

For example:

ITComputer\private$\Orders;RejectedOrders

Moving a message does not change any of its properties, except for the current move count.

Membership in the local Administrators group, or equivalent, is the minimum required to complete this procedure.

To move messages using drag and drop

  1. Click Start, point to Run, type compmgmt.msc, and press ENTER to display the Computer Management MMC console.

  2. In the console tree, click Queue messages or the subqueue that contains the message that you want to move.

    Where?

    • Computer Management/Services and Applications/Message Queuing/YourQueueFolder (such as Public Queues or Private Queues)/MainQueueName/Queue messages or SubqueueName
  3. In the details pane, right-click a message, point to All Tasks, and then click Move.

  4. For Target:, select a queue from the list, or type the path of the target queue as defined in the table above.

    - or -

  5. Perform a drag-and-drop operation on the message, moving it from the source queue to the target queue.

To move messages using cut and paste

  1. In the Computer Management console tree, click Queue messages or the subqueue that contains the message on which you want to perform a cut-and-paste operation.

    Where?

    • Computer Management/Services and Applications/Message Queuing/YourQueueFolder (such as Public Queues or Private Queues)/MainQueueName/Queue messages or SubqueueName
  2. In the details pane, right-click a message, and then click Cut.

  3. Click the name of a valid target queue on the local computer, and then right-click the details pane and click Paste.

Note

The Paste command will be available only if you select a valid target queue.

Additional considerations

  • A subqueue cannot be created explicitly by using MQCreateQueue. Calling MQCreateQueue and specifying the format name of a subqueue returns the error code MQ_ERROR_ILLEGAL_QUEUE_PATHNAME. A subqueue is created implicitly the first time you call MQOpenQueue to open the subqueue. Subsequent calls to MQOpenQueue will open the subqueue. For more information see Creating a Sub Queue.

Additional references