I’ve been using MassTransit over NServiceBus lately … for reasons I won’t delve into now.

Sometimes there is an error when processing a message and it gets thrown in the [name of queue]_error queue. If you have some logging or monitoring setup, you will get messages about the error and want to re-process those messages.

MassTransit comes with another utility called BusDriver that is a command line tool that can move messages from one queue to another.

To just move one message

> BusDriver.exe move –from “msmq://localhost/queue_name_error” –to “msmq://localhost/queue_input”

You can also provide another argument, “-count” that takes the number of messages to move.

> BusDriver.exe move –from “msmq://localhost/queue_name_error” –to “msmq://localhost/queue_input” –count “20”

The above command will move 20 messages from my queue named “queue_name_error” to “queue_input”

Pretty nifty.

There are some other commands in the program that I have not used yet, but feel free to take a gander from the source code @ https://github.com/MassTransit/MassTransit/blob/master/src/Tools/BusDriver/CommandParser.cs