简体   繁体   English

如何从远程计算机读取MSMQ消息而不在本地计算机上安装消息队列?

[英]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.

相关问题 如何从本地Win7计算机上的专用队列获取MSMQ消息计数? - How do I get MSMQ message count from a private queue on local Win7 machine? 如何在未连接远程计算机的情况下将消息发送到远程队列而不将消息保存在传出队列中? - How to send message to remote queue without saving messages in outgoing queue while remote machine is not connected? MSMQ消息多播:无法在其他计算机上接收消息 - MSMQ Message Multicast: Unable to receive messages on different machine 使用MSMQ将消息发送到本地网络上的另一台计算机 - Send message to another machine on local network using MSMQ 如何以编程方式知道机器上是否启用了消息队列? - How to know programmatically whether Message Queueing is enabled on the machine or not? 如果我的MessageQueue是私有的,我的机器可以从另一台本地机器读取消息吗? - Can my machine read messages from another local machine if my MessageQueue is private? 如何使用 C# 运行空间从本地计算机读取 Azure VM 中存在的远程 yaml 文件 - How to read remote yaml file present in Azure VM from local machine using C# Runspace 如何在另一台计算机上读取MSMQ的计数? - How can you read the count of an MSMQ on another machine? 使用 WMI 将文件从本地计算机复制到远程计算机 - Copy a file from local machine to remote machine using WMI 从本地计算机备份远程MySQL数据库 - Backup remote MySQL database from local machine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM