user1713584
user1713584

Reputation: 75

How to setup MSMQ server so that it can be accessed over the Internet

We have MSMQ on a Windows 2008 R2 server, with the followings Firewall settings: 1) Message Queuing is checked in 'Allow programs to communicate through Windows Firewall' 2) Enable TCP port: 2103, 2105, 1801

But when a c# application (using FormatName:DIRECT=TCP:xxx.xxx.xxx.xxx\Private$\q1) attempts to receive the private queue message, it encountered the following error:

System.Messaging.MessageQueueException: Remote computer is not available. at System.Messaging.MessageQueue.MQCacheableInfo.get_ReadHandle()

Is something amiss from the above setup? Please help.........

Thanks, Ben

Upvotes: 2

Views: 5347

Answers (1)

tom redfern
tom redfern

Reputation: 31750

Firstly, your queue address is not correct for an internet enabled msmq queue. It should be of the format

FormatName:DIRECT=http://myQueueServerURL/Private$\q1

You also need to properly configure msmq on the server to allow incoming calls to port 80 (or 443 for https).

Alternatively, you could look at the NServiceBus Gateway, which sits on msmq but takes care of http communication across the internet to another Gateway.

You could also consider using internet-based queuing, for example, Azure service bus.

RE: comment on Receiving from a remote queue across the internet

What you want to do is straight-up impossible with MSMQ.

You can however host the queue locally and then have senders send to you over the internet.

Upvotes: 3

Related Questions