Udostępnij za pośrednictwem


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

  • Anonymous
    November 24, 2004
    Would a reset of the PPC device result in the loss of messages in the queue ?
  • Anonymous
    November 24, 2004
    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.

  • Anonymous
    November 25, 2004
    Maybe worth capturing here for future visitors info on MSMQ with CF 2.0:
    http://blogs.msdn.com/ihim mar/archive/2004/06.aspx
  • Anonymous
    December 11, 2004
    Without HTTP capability on Pocket PC how would you send messages over the internet using MSMQ CE? What firewall ports need to be opened?
  • Anonymous
    December 13, 2004
    I believe you just need to open up ports 3527 and 1801.
  • Anonymous
    May 15, 2006
    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
  • Anonymous
    June 30, 2006
    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.
  • Anonymous
    August 01, 2006
    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?
  • Anonymous
    August 31, 2006

      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....
  • Anonymous
    August 31, 2006
    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
  • Anonymous
    December 12, 2006
    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
  • Anonymous
    March 27, 2007
    The comment has been removed
  • Anonymous
    January 01, 2008
    PingBack from http://movies.247blogging.info/?p=3650
  • Anonymous
    April 25, 2009
    services fail to start wince 6.0 logoff. "services list" command fails