Search code examples
wcfmsmqnetmsmqbinding

Message queueing fails after a few months


We had a problem the other day with MSMQ and I'm trying to understand what is going on.

We have like 10 services sending messages to each other. Some with WCF, other with straight usage of System.Messaging.

At some point not a single message would be sent anymore and all logs would fill up with

"Insufficient resources to perform this operation"

The messages are smaller than 4MB and it has worked for many months so the message size was not the problem.

Looking further in the msmq\storage folder there were 1.07 Gigabytes of message files in there and 950 megabyte of them were files starting with a 'j'.

j0002f0e.mq j0002f0f.mq etc

These messages represent journal files and indeed one (WCF) service sending thousands of messages every day had useSourceJournal enabled.All those files are 4MB in size, the max they all contain multiple queue messages from the past.

Now could this be the cause? Is there some limit of 1GB where journal messages pile up and that MSMQ starts failing then with that general insufficient resources?

Should the journal queue be cleared every once in a while so that the storage folder is (almost) empty?


Solution

  • Journal messages are just like any other message. They take up space until your application does something with them. They aren't like temporary files that the system purges after a while. The idea is that if journaling is enabled (at the message or queue levels) then the messages are important as otherwise you wouldn't bother switching it on in the first place. Processing the journal messages should be part of your application (or at least part of a formal maintenance procedure).

    Journaling has a quota, just like with regular messages.

    Journaling quota