Search code examples
c#xmlmsmqnservicebus

Read message body (raw xml) from MSMQ using Nservice bus before Handle() is called


Is There any way I can read raw xml message from MSMQ using NService bus before it parses it to corresponding class object. I am getting message in Handle(Class obj). This is working fine but I want to log the xml from raw message body which NService parses to class object .


Solution

  • Have a look at transport message mutators. You'll be able to inspect both the Body and Headers of the message