[英]How to read MSMQ messages from a remote machine without installing message queueing on local machine?
There is a remote machine (let's call it MSMQ machine) which has MSMQ installed on it and is used by several other processes. 有一个远程计算机(我们称它为MSMQ计算机),上面安装了MSMQ,并由其他多个进程使用。 I would like to read the messages on a given private queue of the MSMQ machine from my local machine - BUT, I would like to avoid installing Message Queuing on my machine, since what I need is simply to check and monitor the messages.
我想从我的本地计算机上读取MSMQ计算机给定专用队列上的消息-但是,我想避免在我的计算机上安装消息队列,因为我需要的只是检查和监视消息。 I will not send nor receive messages (at least won't store them), I just want to "peek" at them.
我不会发送或接收消息(至少不会存储它们),我只想“窥视”它们。
Is there any way to do this? 有什么办法吗? I have a code more a less like this now:
我现在有更多这样的代码:
public string CheckMessageQueue(machine, queue)
{
StringBuilder Ret = new StringBuilder();
var path = machine "\Private$\" + queue;
try
{
MessageQueue mq = new MessageQueue(path);
Message msg = new Message();
msg = mq.Peek();
Console.WriteLine(msg.ToString());
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
if I run the code above I get the error message 如果我运行上面的代码,我会收到错误消息
"Message Queuing has not been installed on this computer."
“此计算机上尚未安装消息队列。”
No, there is no other way than installing MSMQ on your local machine as well. 不,除了在本地计算机上安装MSMQ之外,别无其他方法。 The client libraries uses the local server to communicate with remote servers.
客户端库使用本地服务器与远程服务器进行通信。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.