The Problem Solver

Tell me and I will forget
Show me and I will remember
Involve me and I will understand
- Confucius -

Google Ads

This Blog

Syndication

Search

Tags

News





  • View Maurice De Beijer's profile on LinkedIn

Community

Email Notifications

Explore

Archives

WCF and poison messages
Working with WCF in general is quite nice. No longer are you troubled by the idiosyncrasies of the various communication protocols as they are bundled into the same API. Of course that doesn’t make the different protocols identical and there are still some differences to be handled. One thing is the netMsmqBinding binding and poison messages.
 
In general it isn’t to hard to handle poison messages. Using Vista you can even reject or move them to  a poison queue for later inspection. Not that much luck in Windows XP though. Basically you have two options, either Fault (the default) or Drop the message.
 
Now dropping the message us not very nice as the information gets lost so faulting and removing and logging the message from a IErrorHandler is a better solution. And in fact an MsmqPoisonMessageException is raised when a poison message is detected. In fact it even contains the MessageLookupId to retrieve the message itself. But how about the queue name? That is missing. And the samples on MSDN show how to do this by adding the queue names twice, once in the WCF configuration and a second time just for the purpose of removing the poison message. Looks like some king of oversight if you ask me. I guess I need to hook into the message pipeline somewhere and watch messages coming in via the queues and record the LookupId and queue used. Only problem is that I haven't found the point to do so yet :-( Any hints are appreciated!
 
Published Wed, Nov 29 2006 18:06 by Maurice
Filed under: , ,

Comments

# flow1800@ Wednesday, July 23, 2008 1:33 AM

ZE9kKQ tfgruj 46rujfgjgh jfhjhf jgfxdj gfj gfjgfjfj gfjgf

# re: WCF and poison messages@ Wednesday, August 13, 2008 8:56 PM

Try to locate the following internal static class with reflector:

System.ServiceModel.Channels.MsmqUri

It contains the logic to convert a Uri to a MSMQ format name, where the uri can be obtained from the IChannelListener of the ChannelDispatcher of the ServiceHost.

by mobilebilly

# re: WCF and poison messages@ Friday, March 20, 2009 11:32 AM

Good post, admin.

# re: WCF and poison messages@ Friday, March 20, 2009 2:06 PM

Good post, admin.

by Xhizors

# re: WCF and poison messages@ Friday, March 20, 2009 7:22 PM

Good post, admin.

# re: WCF and poison messages@ Saturday, March 21, 2009 12:58 AM

Good post, admin.

# re: WCF and poison messages@ Saturday, March 21, 2009 4:08 AM

Good post, admin.

# re: WCF and poison messages@ Saturday, March 21, 2009 6:25 AM

Good post, admin.

# re: WCF and poison messages@ Saturday, March 21, 2009 10:47 PM

Good post, admin.

by onoffon

# re: WCF and poison messages@ Sunday, March 22, 2009 5:07 AM

Good post, admin.

# re: WCF and poison messages@ Thursday, March 26, 2009 7:39 AM

Good site, admin.

by Alex

# re: WCF and poison messages@ Thursday, March 26, 2009 8:44 AM

Good site, admin.

by Alexis

# re: WCF and poison messages@ Thursday, March 26, 2009 9:52 AM

Good site, admin.

by Hot

# re: WCF and poison messages@ Thursday, March 26, 2009 11:33 AM

Good site, admin.

by Sancho

# re: WCF and poison messages@ Thursday, March 26, 2009 3:13 PM

Good site, admin.

by Locker

# re: WCF and poison messages@ Friday, March 27, 2009 1:30 AM

Good site, admin.

by Flash

# re: WCF and poison messages@ Friday, March 27, 2009 2:34 AM

Good site, admin.

by Alex

# re: WCF and poison messages@ Friday, March 27, 2009 10:29 AM

Good site, admin.

by Flash

# re: WCF and poison messages@ Saturday, March 28, 2009 7:14 AM

Good site, admin.

by Flash

# re: WCF and poison messages@ Saturday, March 28, 2009 8:30 AM

Good site, admin.

by Alex

# re: WCF and poison messages@ Saturday, March 28, 2009 8:30 AM

Good site, admin.

by Alex

# re: WCF and poison messages@ Saturday, March 28, 2009 10:46 AM

Good site, admin.

by Hot

# re: WCF and poison messages@ Saturday, March 28, 2009 12:15 PM

Good site, admin.

by Sancho

# re: WCF and poison messages@ Saturday, March 28, 2009 3:07 PM

Good site, admin.

by Locker

# re: WCF and poison messages@ Saturday, March 28, 2009 5:03 PM

Good site, admin.

by Alex

# re: WCF and poison messages@ Saturday, March 28, 2009 10:55 PM

Good site, admin.

by Locker

# re: WCF and poison messages@ Sunday, March 29, 2009 1:16 AM

Good site, admin.

by Flash

# re: WCF and poison messages@ Sunday, March 29, 2009 3:42 AM

Good site, admin.

by Alexis

# re: WCF and poison messages@ Sunday, March 29, 2009 10:43 AM

Good site, admin.

by Alexis

# re: WCF and poison messages@ Sunday, March 29, 2009 1:31 PM

Good site, admin.

by Sancho

# re: WCF and poison messages@ Monday, March 30, 2009 1:29 PM

Good site, admin.

by Alex