Discussion:
MSMQ Over HTTP Problem
(too old to reply)
garydbutler
2008-06-14 17:23:00 UTC
Permalink
I have installed MSMQ with HTTP support on a Windows XP SP2 machine -
independent and NOT Active Directory.

The test server is behind a simple router. The LAN IP address for the
destination queue is 192.168.1.100. I have a dyamic WAN IP but I'm using a
dynamic dns service for accessing the server from the internet. I am
forwarding port 1801 to the msmq server. The queue I'm trying to send
messages to is a private queue.

When I send a message from the internet, the message disappears from my
outgoing queue but never arrives at the destination queue. When I check the
IIS log on the server I can see the POST from my message that was sent so I
know the message is getting as far as IIS on the destination machine.

From inside the local network I can send messages directly to the queue and
they arrive as they should.

I'm not sure what I need to do next to troubleshoot. I've read some about
using mapping files but I also understand that the file syntax is different
for XP and Windows Server versions.

Thanks in advance for you help.

Gary
Frank Boyne
2008-06-16 03:24:30 UTC
Permalink
Post by garydbutler
I'm not sure what I need to do next to troubleshoot.
Generally, one good place to start is John Breakwell's blog:
http://blogs.msdn.com/johnbreakwell/ and in particular his ever growing
series of posts on MSMQ over HTTP not being delivered:
http://blogs.msdn.com/johnbreakwell/archive/tags/MSMQ+over+HTTP/default.aspx

Many of the problems John describes won't apply to your situation
because they manifest themselves as messages getting stuck in the
outgoing queue rather than as messages not being delivered.

A good general diagnostic technique in these situations is to use the
dead letter queue to capture problem messages. If you are using managed
code, set the Message.UseDeadLetterQueue property to true before you
send the message. For native code set PROPID_M_JOURNAL or
MSMQMessage.Journal to MQMSG_DEADLETTER.

http://msdn.microsoft.com/en-us/library/system.messaging.message.usedeadletterqueue.aspx
http://msdn.microsoft.com/en-us/library/ms711367(VS.85).aspx
http://msdn.microsoft.com/en-us/library/ms699843(VS.85).aspx

With one of those properties set, a message that can't be delievered to
the queue will be placed into the system's dead letter queue instead.
You can then use the Computer Management snapin to view the contents of
the DLQ. The message's Class property will be set to a value that
describes the problem, and the Computer Management snapin will translate
that Class value into a text string a human can (usually) understand.

However, this technique doesn't work in all cases as messages in some
circumstances can be discarded without being captured to the DLQ.
Post by garydbutler
When I send a message from the internet, the message disappears from my
outgoing queue but never arrives at the destination queue. When I check the
IIS log on the server I can see the POST from my message that was sent so I
know the message is getting as far as IIS on the destination machine
Does the log show the POST got a good response (i.e., not 404 or some
other error)?
Post by garydbutler
I've read some about
using mapping files but I also understand that the file syntax is different
for XP and Windows Server versions.
This does sound like a good candidate for the cause of your particular
problem. Are you using the IP address or the host name form of an HTTP
format name to address the queue? Assuming you are using the host name
version, the actual host name in the URL has to match the MSMQ server's
hostname (aka NETBIOS name) or else MSMQ assumes the message has been
misdelivered (if I recall correctly, this is one of those cases where
the DLQ doesn't work).

So, for example, if the Command Window command 'hostname' reports that
your MSMQ server's host name is MyServer1 then a format name like
DIRECT=HTTP://MyServer1.example.com/msmq/MyQueue would work but a format
name like DIRECT=HTTP://MSMQServer.example.com/msmq/MyQueue would fail
even if the DNS names MyServer1.example.com and MSMQServer.example.com
resolved to the same (correct) IP address.

To get the second format name to work you'd need to create a redirection
file on the MyServer1 system that specified the MSMQServer URL as the
<from> or <alias> element and the MyServer1 URL as the <to> or <name>
element.

The file syntax is different on XP and Windows Server 2003, but both
systems should contain example files using the correct syntax in the
folder C:\WINDOWS\system32\msmq\mapping. Look in that folder on th
etarget system and you should find the syntax you need. You can read
more about redirection files (including examples for both XP and Windows
Server 2003) here:

Message Queuing HTTP Deployment Scenarios for Microsoft Windows Server
2003 and Microsoft Windows XP Professional
http://download.microsoft.com/download/3/d/8/3d89f9e8-1c1b-4a8b-8c9d-1322c1728d45/MSMQB2B.doc
garydbutler
2008-06-16 03:38:00 UTC
Permalink
I did some more digging into the problem and did use the dead letter queue to
help. I found first that I was getting a "Queue doesn't exist" error. i
modified the mapping.xml file and solved that.

My next error was Access is denied and took a lot of time to solve because
I'm not too familiar with IIS. I found this link
http://support.microsoft.com/default.aspx?scid=KB;En-US;271071 which helped
me configure security for IIS and bingo it worked.

Thanks Frank for the links you provided, I'm sure they'll prove to be handy
in the future.
Post by garydbutler
I have installed MSMQ with HTTP support on a Windows XP SP2 machine -
independent and NOT Active Directory.
The test server is behind a simple router. The LAN IP address for the
destination queue is 192.168.1.100. I have a dyamic WAN IP but I'm using a
dynamic dns service for accessing the server from the internet. I am
forwarding port 1801 to the msmq server. The queue I'm trying to send
messages to is a private queue.
When I send a message from the internet, the message disappears from my
outgoing queue but never arrives at the destination queue. When I check the
IIS log on the server I can see the POST from my message that was sent so I
know the message is getting as far as IIS on the destination machine.
From inside the local network I can send messages directly to the queue and
they arrive as they should.
I'm not sure what I need to do next to troubleshoot. I've read some about
using mapping files but I also understand that the file syntax is different
for XP and Windows Server versions.
Thanks in advance for you help.
Gary
Loading...