Wednesday, January 11, 2012

Programming with MSMQ: and it's installation issues.

MSMQ has already been there for while. Actually it has been here at least 5-6 years (that is only the time I am familiar with it).
The Idea of it is pretty simple:
  1. You have an application with some logic.
  2. Part of this logic is to perform asynchronous calls to some other application logic.
  3. You do not wish that it will affect your performance.
  4. The order of handling those calls has to preserve - the FIFO method.
So, back in the begging of the millennium Microsoft released a nice, free of charge, comes with Windows (PC & server), service called MSMQ - Microsoft Message Queuing. It was not the first attempt but it was stable, free, already inside solution.
This is the idea how it works:
  1. Your main application during it's work can send Messages to some queue (in this case, one of queues inside MSMQ,). This is done by using the System.Messages library.
  2. Some other application, a Windows Service for example, listens to this queue.
  3. Each time a new message arrives it reads it and executes some logic.
  4. After reading the message the message is automatically deleted from the Queue.
How to install MSMQ?
Installation process is quite easy (you might need your Windows installation disk):
  1. Control Panel
  2. Add or Remove Programs
  3. Add/Remove Windows Components (on the left sidebar)
  4. Select "Message Queuing"
  5. Next, Finish

Sometimes happens this installation issue/problem :This issue happened to me yesterday, when I was trying to install the MSMQ on my newly formatted computer:"
The MSMQ Service cannot be started.
Error Code: 0x42C
Error Description: The dependency service or group failed to start.
"
This is what you need to do:
  1. Start button
  2. Run
  3. services.msc - Open the services console
  4. Enable this service "NT LM Security Support Provider". In addition, set it to Manual mode
  5. Install MSMQ again
     
Try making sure that the "Distributed Transaction Coordinator" service is running before installing MSMQ.

2 comments: