Saturday, July 9, 2011

Accessing Microsoft Message Queuing / MSMQ from Clustered Application

Running a generic program in Windows Fail Over Cluster is not as straight forward as I first thought.

I have 2 servers in Domain A running a generic application with Windows Fail Over Cluster.
2 Servers in Domain B running Microsoft Message Queuing and Network Load Balancing.
All 4 servers are on Windows Server 2008 Enterprise.

My application on Domain A Servers is supposed to send Message Queue to MSMQ on Domain B Servers.

This is what I did on my fist attempt:
1. Setup MSMQ private queue on Domain B Servers
2. Run the generic application on one of the Domain A Server
3. The application managed to send the Message Queue over to Domain B servers without any problems
4. Happy with the result, I create a Fail Over Cluster and put the application in
5. To my surprise, the application failed to send Message Queue over

After some searching on the Internet, I realized that:
1. Windows Fail Over Cluster create a Virtual Machine separate from the original host machine
2. Therefore my application is running on a separate machine without access to MSMQ on original host
3. In order to send the Message Queue over, MSMQ resource need to be added into the cluster

Next, I create MSMQ cluster on the Fail Over Cluster and did some simple test:

Notice that there is a difference between Local MSMQ and Cluster MSMQ.
Cluster MSMQ is accessible by right click on the cluster service name.

The solution to this problem: MSMQ need to be added into the Fail Over Cluster

This is how I solved it for my servers:
1. On the Fail Over Cluster Manager, create MSMQ cluster
Note that MSMQ cluster need Cluster Disk, you can use FreeNAS to test on VMWare
2. Add the generic application into the MSMQ cluster
Add MSMQ as the dependency
3. Test to confirm that the application is working correctly

Here's the screenshot of the setup:

1 comment: