简体   繁体   English

在调用Handle()之前,使用Nservice总线从MSMQ读取消息正文(原始xml)

[英]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. 有什么办法可以使用NService总线从MSMQ读取原始xml消息,然后再将其解析为相应的类对象。 I am getting message in Handle(Class obj). 我在Handle(Class obj)中收到消息。 This is working fine but I want to log the xml from raw message body which NService parses to class object . 这工作正常,但我想将NService解析的原始消息正文中的xml记录到类对象中。

Have a look at transport message mutators . 看一下传输消息转换器 You'll be able to inspect both the Body and Headers of the message 您将可以检查邮件的正文和标题

@Chris-Bednarski's answer is correct, but I wanted to add that NServiceBus has auditing built-in which takes the complete messages and passes it on to another queue, so you don't have to do that yourself. @ Chris-Bednarski的答案是正确的,但是我想补充一点,NServiceBus具有内置的审核功能,该功能可以接收完整的消息并将其传递到另一个队列,因此您不必自己执行此操作。

As of version 4, there is another process which feeds off of that queue and persists those messages into RavenDB as well as a UI (called ServiceInsight) that enables you to see everything that flowed through your system. 从版本4开始,还有另一个过程从该队列中馈送并将这些消息持久保存到RavenDB和一个UI(称为ServiceInsight)中,该UI使您能够查看流经系统的所有信息。 You can find it here: 你可以在这里找到它:

http://particular.net/ServiceInsight http://particular.net/ServiceInsight

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM