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

1

2

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

Eulau answered 3/10, 2013 at 9:55 Comment(0)
L
3

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.

Laceylach answered 3/10, 2013 at 13:36 Comment(1)
Set firewall inbound rule to allow traffic for port 80, and then tried reading the q message with FormatName:Direct=xxx.xxx.xxx.xxx/msmq/Private$\q1. But encountered: The specified format name does not support the requested operation. Come across hintslibrary.blogspot.sg/2012/09/… - 'Direct format names that specify the HTTP or HTTPS protocol cannot be used to peek at or receive messages, only to send them.' But then how would you read messages from msmq over the Internet? Thanks for your time.Eulau

© 2022 - 2024 — McMap. All rights reserved.