Ny way to configure MSMQ to receive messages via HTTP on a port other than 80 or 443

msmq

I have a service that receives MSMQ messages and also hosts an API. The API must run on port 80 (for argument's sake, not worth going into here). Other services must be able to send messages to this service via HTTP. Therefore MSMQ must be able to receive messages on a port other than 80 (or 443).

This page on MSDN indicates that it's possible to send messages via HTTP to a port other than 80:

https://blogs.msdn.microsoft.com/johnbreakwell/2008/12/15/sending-msmq-messages-over-http-to-a-web-server-not-listening-on-port-80/

Luckily this isn’t difficult. The address needs to be modified just like using Internet Explorer to browse a web site that’s listening on a different port so just insert the port number after the server name.

For example, here’s the address where the destination web service is listening on port 8080:

DIRECT=HTTP://MyWebServer:8080/MSMQ/Private$/TestQueue

This indicates that it's possible to configure a server at the other end to listen on an arbitrary port. Is this correct? If so, how is it achieved?

Best Answer

It's a multi-step process:

  1. Install the API on the Default website (port 80)
  2. Create an extra website and set TCP Port on Service tab to desired port number.
  3. Stop websites
  4. Go into advanced settings in IIS; change the Site ID of Default website to '99'
  5. Go into advanced settings in IIS; change the Site ID of extra website to '1'
  6. Start websites
  7. Install MSMQ (which can only install onto Site ID 1)

You now have MSMQ and API listening on different ports.