Search code examples
c#iismsmq

MSMQ over HTTP (WAN)


I'm trying to Send a message from One Machine to Another, over the internet, using MSMQ (over http).

I have enabled All the correct bits and pieces as far as I am aware, through add features and roles.

MSMQ Over HTTP has also been included.

I have built my own little c# app.

My Queue is in the format of:

FormatName:DIRECT=$/testqueue (so IP - not FQDN)

When I try to send a Message, the message never hits the target queue.

When I am RDP'd into the server that needs to receive the messages, and use the following from the same app:

FormatName:DIRECT=$/testqueue

It works!

I have added extra permissions (Everyone/Anonymous logon/network service) - full control, to no avail.

Port 80 is open - and I believe that this is the only port that needs to be.

I have also tried this on my windows dev box, as a form of isolation test, and the same thing again! Localhost no problems, adds to the queue as expected, but once I add the WAN IP nothing happens.

All the unsent messages just start filling up outgoing messages indicating no success.

SO'ers please help - Extra Ports required? More Permissions? Looking forward to your help!

Chud


Solution

  • Ok, So I figured it out.

    What one needs to do is create a mapping file.

    1. C:\Windows\System32\msmq\Mapping
    2. Create an xml file (can name it anything you like)

    Add the following to the file.

     <redirections xmlns="msmq-queue-redirections.xml">  
       <redirection>  
          <from>http://servername-OR-IP/MSMQ/private$/testqueue</from>  
          <to>http://localhost/MSMQ/private$/testqueue</to>   
       </redirection>  
     </redirections> 
    
    1. Make sure you restart the Messaging Service (start->run->services.msc->Message Queuing->right click->restart

    This worked for me. Hope this helps someone down the track.

    Chud