MSMS outgoing Queue has a large number of unprocessed messages

Itamar Kasztelanski 66 Reputation points
2021-10-17T10:04:09.113+00:00

Hi,
I have a server with MSMQ running.

In send messages to other servers. Not all the are active all the time.

Messages are stuck in the outgoing Queue until the target server up and responding.

I have a task that clears all the non-active outgoing queues.

The have some outgoing queues that show they have 1700 messages the majority are in the unprocessed (msqs).

When I try to purge the messages manually or the admin console, I see only one or two messages.
When I run the PowerShell command, I get UnprocessedMessageCount: 1788 and BytesInQueue : 4541616.
I am unable to clear the messages with PowerShell command.

Is there a way to clear these messages, they are taking a big part of the server's MSMQ storge?

Thanks

Itamar

The cleanup comma

Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,364 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,336 Reputation points
    2021-10-19T09:08:00.633+00:00

    Hi there,

    You can try out these approaches ,

    1. In computer management, go to the security properties of the queue, take ownership through the Advanced button, and set permissions to what you want.
    2. Find the queue config file in the system32\msmq\storage\lqs directory and delete the file; the queue name will be inside the file you want. When you restart the MSMQ service, the queue will have disappeared.

    The Clear-MsmqQueue cmdlet clears queues. Specify queues to clear by using MessageQueue objects. This cmdlet returns a MessageQueue object that represents the cleared outgoing queue.

    PS C:\> Get-MsmqQueue -Name "Order*" | Clear-MsmqQueue


    --If the reply is helpful, please Upvote and Accept it as an answer--

    0 comments No comments