MSMQ on the PocketPC

I was asked last week to say a few words about MSMQ on PocketPC's, and especially MSMQ over HTTP.  I'm happy I got the request.  I've been struggling to come up with *good* stuff to blog about.  Emphasis on good stuff.  I'm not quite enough of a loser to do the "what I had for breakfast blog" :).

MSMQ (Microsoft Message Queueing) is well documented on MSDN so I won't dig into the details here.  The gist of MSMQ is that an application can send a message to a remote machine via the MSMQ service running on the local device.  MSMQ takes care of sending the message from there, hiding all the nasty details about setting up a network connection and the like.  MSMQ also supports transactions and lets apps send messages even when the device isn't on the network.  MSMQ buffers up the messages and auto-detects when a device comes back on a network, and then will send any pending messages.  It's very cool for say a delivery man who has a PocketPC and is away from the network all day out on his rounds, then docks the PPC at the end of the day to some network connection.

MSMQ is available as an optional component for OEMs using Windows CE.  It is not built into the ROM of PocketPC's.  It's a trade off between amount of ROM available on the device versus how frequently we think the feature will be used.  This tradeoff in another area will bite us really hard, as you'll see below.

Because MS knows MSMQ is a cool feature for PocketPC's, we enable this scenario through slightly different means.  We ship MSMQ in redistributable form in our PocketPC SDK.  We give you the required DLL's + Exe's in \Program Files\Windows CE Tools\wce420\POCKET PC 2003\Support\Msmq\ (for ppc2003 SDK).  We leave it to the developer to figure out how to get these bits onto the device, along with their application that uses MSMQ.

The initial versions of MSMQ used only a proprietary Microsoft network protocol.
For Windows XP, an HTTP/XML based transport was developed.  The underlying core features of MSMQ are maintaned.  MSMQ still hides yucky connection/transaction/etc... stuff from apps.  Using HTTP as the transport, we can go across the Internet more easily and (in theory) work with another implementation more easily, too.

I added the HTTP protocol to CE MSMQ back in late 2001.  It has been available to OEMs since CE 4.0.  PocketPC 2003 was built on CE 4.2 and also shipped MSMQ in the SDK.  So you can use HTTP + MSMQ on PocketPC 2003, right?  Wrong :(.

The issue gets into the ROM usage on PPC's.  We shipped MSXML2, not MSXML3, on PocketPC 2003, to save ROM.  The MSMQ HTTP transport on WinCE uses SAX extensively, which is an MSXML3 only feature.  So there is no MSMQ HTTP option on PocketPC.

In theory you can hack MSMQ+MSXML3 onto a PocketPC if you had the right ARM bits.  In practice, though, there are legal restrictions barring people from taking system components like this and putting them on a PocketPC.  Sorry.

Will MSMQ with HTTP be available on the next version of PocketPC?  Again, the lawyers rear their heads here.  I can't promise any feature for a future version of CE or PocketPC.  I probably can't even promise that the next version of CE will have a thread scheduler or a file system :(.  Let's just say there's a decent chance that next PocketPC version will support MSMQ over HTTP.  Please don't base your next product off this, since nothing is written in stone yet!

This is assuming the thread scheduler and the filesystem make it in of course.  MSMQ has some dependencies on the scheduler and filesys, believe it or not :).

UPDATE 2/8/06: Windows Mobile has shipped and it does include the thread scheduler and filesystem.  It also includes MSMQ as an optional SDK CAB installation, but this time around it includes HTTP support.  The existing functionality (binary protocol) is also still included.  Be sure to carefully read the install and configuration documentation, as you need to explicitly enable binary and/or HTTP protocols via the registry (or through the MSMQ administration tool).

[Author: John Spaith]