We have a WCF service hosted in IIS which has a netMsmqBinding. Before the message is dispatched to our service, we would like to log the MSMQ Lookup ID. Where I can I find this information?
We get it in an IErrorHandler because an MsmqPoisonMessageException has a MessageLookupId property. We need to log it at the start of a request so we can correlate the exception with the message.
I thought an IDispatchMessageInspector would be the right place for this, but I can't seem to find any property in the AfterReceiveRequest method that would give me the Lookup ID.
So far the only solution I've found is to use reflection on the Message parameter of
AfterReceiveRequest. It works, it just seems strange this isn't surfaced as a public property.