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?