You can use managed code to clear the outgoing queue:
using (var msgQueue = new MessageQueue(GetPrivateMqPath(queueName, remoteIP), QueueAccessMode.ReceiveAndAdmin)) { msgQueue.Purge(); }
in which GetPrivateMqPath:
if (!string.IsNullOrEmpty(remoteIP)) return String.Format("FORMATNAME:DIRECT=TCP:{0}\\private$\\{1}", remoteIP, queueName); else return @".\private$\" + queueName;
QueueAccessMode.ReceiveAndAdmin points to an outgoing queue.
Daniel B
source share