简体   繁体   English

MSMQ和记录

[英]MSMQ and Logging

I have a situation where I'd like to keep a history or log of all MSMQ messages which have been processed (at least for a period of time). 我有一种情况,我想保留已处理的所有MSMQ消息的历史记录或日志(至少在一段时间内)。 I realize that I can look at the current Queues using Computer Management -> Services and Applications -> Message Queuing. 我意识到我可以使用计算机管理 - >服务和应用程序 - >消息队列来查看当前队列。 But what I'd like is a history or log of the messages which have already been processed. 但我想要的是已经处理过的消息的历史或日志。

I have so far been unable to find a non-programmatic way to do this. 到目前为止,我还没有找到一种非编程方式来做到这一点。 Ideally, it's a simple as setting an MSMQ property so that all messages get logged to either a file or even the windows log. 理想情况下,设置MSMQ属性非常简单,以便所有消息都记录到文件甚至Windows日志中。

Does anyone know if this (or something similar) is possible? 有谁知道这个(或类似的东西)是否可能?

You can do this with target journaling. 您可以使用目标日记功能执行此操作。 This is assuming you want to store the message on the receiving machine? 这是假设您要将消息存储在接收计算机上? From MSDN: 来自MSDN:

Target journaling is the process of storing a copy of incoming messages. 目标日记是存储传入消息副本的过程。 It is configured on a queue basis. 它是基于队列配置的。 When target journaling is enabled, a copy of each incoming message is placed in the target-journal queue when the message is removed (read) from the target queue. 启用目标日记功能后,当从目标队列中删除(读取)消息时,每个传入消息的副本都将放置在目标日志队列中。 A target-journal queue (Journal) is created for each queue when the queue is created. 创建队列时,将为每个队列创建目标日记队列(Journal)。 MSMQ Explorer displays target-journal queues under each public queue. MSMQ Explorer在每个公共队列下显示目标日志队列。

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

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