MSMQ cannot delete or purge a queue
Asked Answered
I

4

13

I'm very new to MSMQ. We have a critical system using MSMQ and it is not able to start due to insufficient resources. It appears that MSMQ is at capacity. I am trying to purge messages (or even delete unneccessary queues), but I receive the following error when purging:

Cannot delete all messages from queue. Error: Access to Message Queuing system is denied.

What are my options? Is there a way to delete queues when the services is off?

Individually answered 13/10, 2009 at 15:39 Comment(1)
Ok, it seems that rights on individual queues have somehow changed. Still trying to figure it out.Individually
G
5

If you open Computer Management on the machine, expand the Services and Applications node (Features on 2008) and right-click on the Message Queuing service.

Right click on the Properties option and open it up to the General tab.

You can specify storage limits for messages -- you may have ran into the upper limit for messages storage. If you temporarily increase this value, it may allow you back into the messaging system so you can purge out those queues and restore operation.

Failing that, if you can deal with the loss of the messages (which if you are trying to purge I presume is okay), maybe delete the queue and recreate it.

Guileless answered 13/10, 2009 at 16:59 Comment(1)
Yes, after raising the Quota for the service I was able to access the queue. Though there seems to have been a secondary problem where the account I was using lost rights as well, but the service trying to read the queue had rights and could do so after raising the quota. This was on MSMQ 2.0 btw.Individually
T
15

There's an easier way:

  • Open Computer Management on the machine,
  • expand the Services and Applications node (Features on 2008),
  • expand the Message Queuing service,
  • expand the private queues folder,
  • expand the private queue you're working with,
  • right click onto the queue messages folder and
  • click the purge option.
Tal answered 11/6, 2012 at 14:17 Comment(0)
I
8

I think there is rights issue.

You are not able to give rights then do following step for forcefully delete queue.

  1. Stop following services
Message Queuing Triggers,
Net.Msmq Listener Adapter
Message Queuing.
  1. Go to C:\Windows\System32\msmq\storage\lqs

  2. Now open file in notepad or notepad++ and

    see the name of queue at QueueName=\private$\YourQueueName

  3. Before delete file backup the file. Now delete that file.

  4. Don't delete other file which does not have your queue name.

  5. Do these things as your own risk.

  6. Now start following services

Message Queuing Triggers,
Net.Msmq Listener Adapter
Message Queuing.

This trick work for me...

Incinerator answered 11/7, 2012 at 10:6 Comment(1)
After finding that I had a problem wherein an application created 3 private queues, but I had no access to them, even though my account is in the local administrator's group, I tried the above suggested solution, but slightly different. Instead of backup up and deleting the files, I simply renamed them by adding a ".save" extension. After restarting all the MSMQ services, the queues were listed as missing or unable to be accessed in Computer Management. I shut down the MSMQ services, moved the files out of the directory, started MSMQ services back up, and now the queues are indeed gone.Abacus
G
5

If you open Computer Management on the machine, expand the Services and Applications node (Features on 2008) and right-click on the Message Queuing service.

Right click on the Properties option and open it up to the General tab.

You can specify storage limits for messages -- you may have ran into the upper limit for messages storage. If you temporarily increase this value, it may allow you back into the messaging system so you can purge out those queues and restore operation.

Failing that, if you can deal with the loss of the messages (which if you are trying to purge I presume is okay), maybe delete the queue and recreate it.

Guileless answered 13/10, 2009 at 16:59 Comment(1)
Yes, after raising the Quota for the service I was able to access the queue. Though there seems to have been a secondary problem where the account I was using lost rights as well, but the service trying to read the queue had rights and could do so after raising the quota. This was on MSMQ 2.0 btw.Individually
P
2

Get hold of a copy of Queue Explorer - it's a commercial app but the trial is fully functional and it's worth it's weight in gold when debugging MSMQs http://www.cogin.com/mq/

If you don't have permissions though, then you don't have permissions! Are you a box admin? If you go to computermanagement and right click on one of your privete queues and select properties can you access the security tab and edit/see the permissions there?

Provision answered 13/10, 2009 at 15:45 Comment(1)
I am using Queue Explorer. I don't believe that it is the account rights, I have been able to add/delete/purge queues in the past. This seems to be connected to the fact that the queues are too full.Individually

© 2022 - 2024 — McMap. All rights reserved.