I am trying to find a way to pause a private queue. Is this possible? It looks like this is possible on an Outgoing queue, but not a private queue? I see that using a Powershell cmdlet you can call Suspend-MsmqOutgoingQueue, but that only works for an Outgoing queue. You can also do the same in .net for an outgoing queue by calling MSMQOutgoingQueueManagement.Pause (but again, not on a private queue).
We are trying to use an automated job scheduler to pause the queue when our system is in a maintenance mode so we don't end up losing our messages when we hit errors from the DB being down, or when it is being backed up.
There are no APIs that will do that on a private queue.
How about making the private queue transactional? If it is transactional (and you process messages as such on the receiving end) then when errors occur (DB related or otherwise) then the message is kept in the queue.
If you're going to do this then pay attention to the settings for poison messages. You don't want your message to be removed from the queue after it has failed N times to process.