4

There is a remote machine (let's call it MSMQ machine) which has MSMQ installed on it and is used by several other processes. 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. 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."

1
  • Another option may be to create some endpoint on the target (MSMQ) machine using, say, web-api and then access that from the client.
    – Eben Roux
    Commented Dec 31, 2016 at 16:48

1 Answer 1

2

No, there is no other way than installing MSMQ on your local machine as well. The client libraries uses the local server to communicate with remote servers.

2
  • How install MSMQ programmatically and silent in Windows 7, and Windows 8 ?
    – Kiquenet
    Commented Nov 21, 2014 at 21:52
  • 1
    You could maybe use the Install-MSMQ PowerShell cmdlet from get-carbon get-carbon.org/help/Install-Msmq.html. But it seems like it is not that stable for Win 7. Or you could use a WiX Custom Action to install it just like in this answer stackoverflow.com/a/21379182/131645. But I would recommend that you install it manually as it is a server component that can run on a client computer just like IIS. Commented Nov 25, 2014 at 22:56

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.