I want to log the Poison message that my wcf service is dropping using MSMQ 3.0 and windows 2003
views:
193answers:
3
+1
Q:
I want to log the Poison message that my wcf service is dropping using MSMQ 3.0 and windows 2003
A:
You could probably add a service like the following that reads messages from your poison queue and logs them.
<service name="YourPosionMessageHandler"
<endpoint
address="net.msq://locahost/private/YourServiceQueue;poison"
binding="netMsmqBinding"
/>
</service>
aogan
2008-09-23 10:51:31
This only works with MSMQ 4.0. MSMQ 3.0 doesn't support poison queues.
Keith Elder
2008-12-18 21:46:07
+1
A:
You can implement a custom IErrorHandler and associate it with your service using a custom behavior. In your implementation, check if the exception raised is of type MsmqPoisonMessageException, and if so, go out and grab the message from the queue using System.Messaging,MessageQueue and log it.
There's a sample that shows how most of this stuff is done: it moves the message to another queue, but should be trivial to modify it so that it just logs the message somewhere instead.
tomasr
2008-09-23 13:52:40
A:
There is a perfect example for this on MSDN. http://msdn.microsoft.com/en-us/library/ms751472.aspx
Olivier
2009-02-18 08:20:27