What is MSMQT?

So, What is MSMQT? I (stupidly as it turns out) just thought it was a new revision of MSMQ shipped with BTS04 that replaced or extended the built-in MSMQ functionality. Oh did I get that wrong!! J

MSMQT ships with BizTalk 2004 primarily to get around the 4MB MSMQ limit which was a pain in previous versions of BTS and any other application that used MSMQ, this means you can now chuck big messages at BTS via MSMQ with ease, and BTS implements streaming of messages so it doesn’t have to load it up in memory to do any processing (unless you want it to).

MSMQT is a completely seperate beast to MSMQ, you don’t create Queues via the MMC snap-in, nor can you “see” the queues via the admin tools, you can think of MSMQT as being a MSMQ “listener” which implements the same core features such as MSMQ authentication and transactions. MSMQT listens on the standard MSMQ port for messages and ensures they are delivered straight to the MessageBox via a configured pipeline; it “speaks” the MSMQ binary protocol so the usual MSMQ client APIs work just fine, as far as they’re concerned they’re talking to a MSMQ queue.

As it listens on the same port MSQMT does not coexist with MSMQ, you cannot have it running on the box – There is a workaround for this in the BTS04 documentation but the advice is not to use it unless you need to. 

You don’t configure queues per-se anymore, instead when you create a MSMQT Receive location you configure a “Queue Name”, clients then send messages to that queue name using the usual MSMQ naming convention:

FormatName:DIRECT=OS:MyServer\private$\MyQueue

The Message then arrives at the MessageBox with the client specified “Queue Name” in the Message Context information, the MSMQT Receive Port configured for your application picks it up (if the queue names match) and processes it, if the queue names don’t match then the message will be suspended as nothing has “subscribed” to a message arriving on that queue.

However, if you want to send large messages from a MSMQ client (those being larger that 4MB) you can’t use the “standard” MSMQ API’s, you’ll have to deploy the mqrtlarge.dll (supplied in the BTS install) and then use the special APIs (MQSendLargeMessage and MQReceiveLargeMessage), these are standard API calls so you’ll need to Interop. I haven’t tried doing this yet to see if there’s any other gotchas!

The documentation doesn’t seem to do a really good job at explaining what MSMQ is (and isn’t), unless I’ve missed a vital section. Hope this helps!