I am having an issue with WCF and clustered MSMQ and hoping someone could
help me here.
When I start Consol host, it starts receiving messages from MSMQ. I am able
to send new messages from Windows client and consol application will process
it.
Now, active server in cluster dies and it fails over to second server.
After failover, no new messages will be processed until I restart the consol
service. I do not see any errors in Event Log or Trace. Everything seem to
be working as normal.
Both of the cluster servers are setup identically. The Consol application
will receive from both servers after restart. So, it not permission issue or
setup issue.
Does anyone know why it stops processing message after failover?
And, how to fix this issue?
Here is my setup:
2 Windows 2008 server joined as cluster and MSMQ.
1 Console application hosting WCF Service.
1 Windows client to send messages to MSMQ.
Thanks for your help…
I don't think this is a cluster-specific problem. I epxect you would have
the same problem on a standalone machine if you simply restarted the MSMQ
service (which is what happens on a cluster failover).
After MSMQ restarts, all existing queue handles will be stale so the
application will need to reopen the queue to get a fresh handle.
There should be an exception raised when the application tries to read a
message with a stale queue handle.
So you need to add code to catch the exception and act accordingly by
closing and reopening the queue.
Cheers
John Breakwell (MSFT)
"Bhavesh Shah" <Bhave...@discussions.microsoft.com> wrote in message
news:07C325C6-AC10-4AB2...@microsoft.com...
You are correct. I was able to find that error by adding tracing for
ServiceModal.
I do get the Service Faulted exception. I was able to modify the
application to catch the exception and restart the service host. After
restart, service is able to process new messages.
Now, I am trying to host this service on IIS 7 using WAS and seeing the same
behavior. My understanding was that the WAS process should catch the
exception try it again. Everything work fine before failover but after no
new messages are processed. I am able to send messages to backup server but
they just stay in the queue.
I do not know how to catch faulted exception in WAS so I can restart the
ServiceHost.
Thanks for you help