Microsoft Message Queuing (MSMQ) Services
- Message Queuing Server
- Directory Service Integration
Microsoft Message Queuing or MSMQ is a message queue implementation developed by Microsoft and deployed in its Windows Server operating systems since Windows NT 4 and Windows 95. MSMQ is essentially a messaging protocol that allows applications running on separate servers/processes to communicate in a failsafe manner. A queue is a temporary storage location from which messages can be sent and received reliably, as and when conditions permit. This enables communication across networks and between computers, running Windows, which may not always be connected. By contrast, sockets and other network protocols assume that direct connections always exist.
Surprisingly enough you not only have to have required MSMQ components installed but also you have to have them in a working state. 🙂 For example MSMQ is a requirement for working Notification Events which provide the functionality to notify via e-mail when specific events are executed on servers, implementing a custom event record. The queuing of events is processed using MSMQ. Transactional queue’s are received from the client recorder to be persisted to the Event database. The Event database receives events from the Queuing System (MSMQ) and saves event mappings to the database for processing. (see details here). Both Notification Events and E-mail Events in K2 are depending on MSMQ.
The other day I had a case when K2 server was restored from backup and it was noticed that notification events does not work, K2 Setup Manager was run to double check email related settings and it raised a warning about MSMQ. First of all I confirmed that MSMQ components are installed and they were in place, so I attempted to start MSMQ service but it wailed to start with the following error message:
The Message Queuing service terminated with service-specific error %%-1072823311
As a message text suggests it is worth checking application specific logs, which in MSMQ case can be found in Windows Event viewer. In this specific case I was able to see the following event logged upon each attempt to start MSMQ service:
Event ID 2078 — Message Queuing Logging and Checkpoint Events
The Message Queuing service cannot start. The checkpoint files cannot be recovered. Error %1: %2
The rest was easy as MSFT provides guidance/details on this, see Message Queuing Logging and Checkpoint Events. Event ID 2078 normally occurs when there is a failure between the time that the checkpoint file was created and when the QMLog was updated with the new version, the QMLog file refers to the earliest checkpoint file version and recovery fails. So this is something you may run into after system restore. Resolution to this is the following:
1) Delete all the checkpoint files, as well as the QMLog file in the Message Queuing storage directory (%windir%\system32\msmq\storage, see Message Queuing Message and Data Files for details). This can result in some messages being duplicated. However, this resolution will get the service running as soon as possible and usually without data loss.
2) Open registry editor and navigate to:
registry hive and there locate LogDataCreated parameter and ensure that its value is set to 0.
3) Try to start Message Queuing service – it should work now.
Link to related MSFT documentation with more detailed steps:
While working on this I also noticed that strange/confusing issue when MSMQ is installed on Windows Server 2008 R2 box but no relevant management node/snap-in was available in Server Manager but this is a separate issue worth separate investigation (some relevant reading is here and here), but probably just re-registering the MQSNAP.DLL can fix this.