0

I have a server (say server A) where I configured a private MSMQ for queueing the messages and deployed an application on another server (say server B) to send messages. Server A and server B are not in the same network or domain. We have opened port 1801 on server A for the communication with MSMQ.

And we are using below code for sending messages from Server B to Server A

                var queue = @"FORMATNAME:DIRECT=TCP:<remote_server>\private$\<queuename>";
                var messageQueue = new MessageQueue(queue);

                var message = new Message("Hi Message");
                messageQueue.Send(message);

It is working fine if I send messages from Server B to the remote server A.

But if I try to delete all messages from the queue using the application hosted on the server A,it will throw the below exception

remote computer is not available.

I am using the below code for purging the queue.

 var queue = @"FORMATNAME:DIRECT=TCP:<remote_server>\private$\<queuename>";
              var messageQueue = new MessageQueue(queue);

                messageQueue.Purge();

I have set below two properties [UrQueueName] -> Properties -> Security for testing

  • Set Everyone to Full Control
  • Set ANONYMOUS LOGON to Full Control.

How can I find out what the exact issue with purging, as I can send the messages to this remote server?

Do I need to open any other ports for purging other than 1801?

halfer
  • 19,824
  • 17
  • 99
  • 186
Kesiya Abraham
  • 753
  • 3
  • 10
  • 24
  • Do you have the remote computer B connected to A. You can only have one connection at a time and if remove is connected then you cannot connect locally with an application on A. – jdweng Sep 23 '19 at 15:16
  • No, while purging the queue, there would have only one connection. – Kesiya Abraham Sep 23 '19 at 15:36
  • Try from cmd.exe > Netstat -a and check status with remote connect and when remove is not connected. You can also try on remote also. You should see listening only. Question : If computers are not in same network than how are they communicating? Maybe you have third server. – jdweng Sep 23 '19 at 15:48

0 Answers0