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]

Comments (16)
  1. Serdar Kilic says:

    Would a reset of the PPC device result in the loss of messages in the queue ?

  2. John Spaith says:

    It depends on what type of messages you’re using. From http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnce30/html/wce3appserv_msmq.asp

    Message Delivery Methods

    MSMQ supports two delivery methods: express and recoverable. Express messages are usually faster and consume fewer resources, but data loss is possible if the computer with the message queue were to fail. Recoverable messages are slower than express messages and consume more resources, but they can be recovered in the event of a system failure.

  3. Daniel Moth says:

    Maybe worth capturing here for future visitors info on MSMQ with CF 2.0:

    http://blogs.msdn.com/ihim mar/archive/2004/06.aspx

  4. Without HTTP capability on Pocket PC how would you send messages over the internet using MSMQ CE? What firewall ports need to be opened?

  5. John Spaith says:

    I believe you just need to open up ports 3527 and 1801.

  6. Tom says:

    I am working on MSMQ on PPC 2003 SE recently. But somehow got trouble on send msg from PPC to an network computer. I could create/send/receive msg queue local but once I try to send msg to a network server or my laptop, get error msg : "The queue does not exist or you do not have sufficient permissions to perform this operation". MSMQ in PPC 2003 only support local private queue?

    Very appriciate any help with this. my email: tom.guan@sidlergroupl.ca

  7. bhag says:

    Hi,

    i am trying to MSMQ example given WinCE 5.0 SDK (WINCE500PUBLICSERVERSSDKSAMPLESMSMQCLI). on WinCE x86 Emulator.

    i am able create the message queue. But during creation i am getting following exception in Platform Builder.

    60500 PID:c3e2b93a TID:a3dc4f36 Exception 00e Thread=83d7dcb0 Proc=c3e2b93a ‘services.exe’

     60500 PID:c3e2b93a TID:a3dc4f36 AKY=00000281 PC=03fb3d97(coredll.dll+0x00013d97) ESP=1402eff0 EA=00000004

     60500 PID:c3e2b93a TID:a3dc4f36 Exception ffffffff Thread=83d7dcb0 Proc=c3e2b93a ‘services.exe’

     60500 PID:c3e2b93a TID:a3dc4f36 AKY=00000281 PC=03fb50e6(coredll.dll+0x000150e6) ESP=1402ea50 EA=00000000

    How to go about it? Is there any setting i am missing?

    TIA.

  8. praveen gowda says:

    H,i i am using msmq to send and recieve messages on a ppc  from a host machine which is a pc. when the ppc application is running i have an inboundQueue_ReceiveCompleted event which  gets me the messages.

    The question here is when the host sends me around 1000 messages  and if i log off the client application and login back would i recive all the message or would some messages be lost?

  9. praveen gowda says:

      Hi ,  I have an application using msmq on ppc 2003 and wm5 device.  Application on the ppc is a client and i happen to recive messages from a host which is a PC. I am losing messages on the cleint if  the Host ie the PC sends me messsages in bulk ie around 4000-6000 messages.

    They do leave the PC and i do have set the inbound queue (ie my ppc inbound queue) size to infinity ie inboundQueue.MaximumQueueSize = MessageQueue.InfiniteQueueSize;

    I use the asyncronous ReceiveCompleted  eventhandler  to get the meesages out from the inbound queue.

    any idean on this….

  10. cenet says:

    I agree I think this has to  do with queue size/quota.  6000 messages is an awful lot, I’m wondering can you check if your PPC has exhausted its memory supply either in RAM or in storing all these msgs?  WinCE processes can only handle 32 MB of RAM per proc, regardless of available memory.  (This is being fixed in CE 6.0 BTW.)  Another possibility is that the queue quota change isn’t taking – I can look it up if needed, but the quota may (?) be something you need to set right after creating the queue.

    Another idea (just for dev purposes at least) is checking out

    HKLMSOFTWAREMicrosoftMSMQSimpleClient

    And setting DefaultQuota, DefaultLocalQuota, and MachineQuota to be big.  MSDN docs these, which are global quota size in KB.  You’d need to stop+start MSMQ service to make these take affect and the quota only applies to queues created after you have made the change, not to previously created ones.

    If we want to continue the discussion, let’s take it to a newsgroup (http://blogs.msdn.com/cenet/archive/2005/12/05/500181.aspx lists) since the blog isn’t a very convenient channel for back+forth talks like this.

    John

  11. Deepthi says:

    Hi,

    I am trying to send messages between my windows server 2003 and windows mobile 5.0 device using msmq over http. Is it possible to send messages over http using msmq in .net cf 2.0 ? I read in Marcus Perryman’s Weblog (http://blogs.msdn.com/marcpe/archive/2006/02/01/522112.aspx) that support for msmq over http is not avaiable right now because of a bug. Could you please clarify the same asap?

    Thanks,

    Deepthi

  12. Andy Wigley says:

    Hi Deepthi,

    The HTTP bug in MSMQ for Windows Mobile 5 has been fixed, and the current download of the Optional Redistributable Server Components (http://www.microsoft.com/downloads/details.aspx?FamilyID=cdfd2bb2-fa13-4062-b8d1-4406ccddb5fd&DisplayLang=en) includes the fix.

  13. learner says:

    services fail to start wince 6.0 logoff. "services list" command fails

Comments are closed.

Skip to main content