0

Context - Server 2008 R2 with private queue, IIS setup. Sending messages via HTTP from other computers. [MSMQ is not in the 'default web site'. I changed the ID of my website to 1 to install msmq (after previously un installing it)]

I could do with some help. I've read through all the 'msmq messages over http just don't get delivered' and looked into this a lot, but just can't get it working.

I CAN get the queue to receive messages if I use the IP address, not if I use the FQDN that resolves to the same IP address. I need the Domain Name to work, since my next step is to get SSL to work and obviously my cert if for the full domain name!

I have a very simple app that sends the following messages:

Private Function SendStuff() As String

    Dim output As String = "Mesages Sent To" & Environment.NewLine

    Dim Addresses As New List(Of String)
    Addresses.Add("Direct=HTTP://46.0.0.206/msmq/Private$/test.q")
    Addresses.Add("Direct=HTTPS://46.0.0.206/msmq/Private$/test.q")
    Addresses.Add("Direct=HTTP://subdomain.domain.net/msmq/Private$/test.q")
    Addresses.Add("Direct=HTTPS://subdomain.domain.net/msmq/Private$/test.q")

    For Each address In Addresses

        Dim fullAddress As String = "FormatName:" & address

        Dim mq As New System.Messaging.MessageQueue(fullAddress)
        Dim mm As New System.Messaging.Message()


        Dim body As String = "Hello via constructor " & fullAddress

        With mm
            .Body = body
            .AcknowledgeType = Messaging.AcknowledgeTypes.None
            .UseAuthentication = False
            .TimeToReachQueue = New TimeSpan(0, 20, 0)
            .Label = address.Substring(7, 14)
        End With

        mq.Send(mm)
        output = output & Environment.NewLine & fullAddress
    Next
    Return output
End Function

On the server, in the IIS logs, we get exactly this:

2014-03-07 09:04:02 46.0.0.206 POST /msmq/private$/test.q - 80 - 83.0.0.130 - 200 0 0 31 
2014-03-07 09:04:02 46.0.0.206 POST /msmq/private$/test.q - 443 - 83.0.0.130 - 200 0 0 46
2014-03-07 09:04:02 46.0.0.206 POST /msmq/private$/test.q - 80 - 83.0.0.130 - 200 0 0 78

I get 1 message in the test.q, I expect 2 (both from the HTTP protocols, the httpS I don't expect yet, but would be nice :)

Messages Received:

    <?xml version="1.0"?>
<string>Hello via constructor FormatName:Direct=HTTP://46.0.0.206/msmq/Private$/test.q</string>

Can anybody inform me on what to look at next, there's nothing of interest in the Servers/Receiving computers Event log, despite me turning on 'end to end', logging I get nothing in "applications and services log\Microsoft\Windows\MSMQ' It's got 0 messages in it.

ANY help appreciated.

Thanks

0

Ok, so the solution was simple.

It seems pretty clear all the documentation was made prior to the HTTP option, hence the lack of just one example.

You need to add a redirection for MSMQ, from FQDN.com to localhost.

You do this by adding an XML file under: C:\Windows\System32\msmq\Mapping

With the following contents:

<redirections xmlns="msmq-queue-redirections.xml">
  <redirection>
      <from>http://FQDN.com/msmq/private$/test.q</from>
      <to>http://localhost/msmq/private$/test.q</to> 
  </redirection>
</redirections>

Done

  • That doesn't look right. You've found a workaround, I think, for an underlying problem outside of MSMQ. You shouldn't need to redirect to localhost. Redirection is normally used when FQDN doesn't match the computername. – John Breakwell Feb 2 '15 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.