Compartilhar via


MSMQ in the .NET Compact Framework 

The .NET Compact Framework version 2.0 supports Message Queuing (also known as MSMQ) in Windows CE. MSMQ makes it possible for applications to communicate with other applications across networks and systems that might be temporarily offline.

For a complete sample of using MSMQ in the .NET Compact Framework, see MSMQ Book Order Application Sample.

To use this service, applications send messages to a message queue. A message queue can hold messages for both the sending and receiving applications that are either on the same device or on different devices.

When a network connection is established, MSMQ delivers messages into the remote queue regardless of whether a receiving application is running or not. The receiving application can check for messages in its local queue at any time.

MSMQ is not built into the Windows CE operating system on a Pocket PC, but you can install it, start the service, and create applications that use it. The following describes how to get the MSMQ component:

  • The Windows Mobile 2003 for Pocket PC SDK provides MSMQ for Pocket PCs running Windows Mobile 2003 for Pocket PC.

  • Devices running Windows Mobile Version 5.0 software for Pocket PCs or Smartphones can download the MSMQ component from the Redistributable Server Components for Windows Mobile 5.0.

  • MSMQ is not available for Windows Mobile 2003 for Smartphone.

  • MSMQ is available to Windows CE device developers using Microsoft Platform Builder.

Windows Mobile 2003 for Pocket PC does not support the HTTP-based protocol SRMP (SOAP Reliable Messaging Protocol), so you must use a proprietary MSMQ protocol for sending messages. SRMP is supported by Windows Mobile version 5.0.

The .NET Compact Framework supports only the XmlMessageFormatter for serializing and deserializing messages to and from the message queue.

The .NET Compact Framework does not support the following features, because they are not available in Windows CE:

  • Multiple message transactions. Transaction support is limited to single message transaction.

  • Remote queue read.

  • Encryption.

  • Security based on an Access Control List (ACL).

  • MQMail.

  • Public queues based on Active Directory.

Because Active Directory is not supported on devices, the .NET Compact Framework cannot determine if a remote queue is transactional. To send a message to a remote transaction queue, the following is required:

  1. Add ;XACTONLY to the queue path in MessageQueue constructors that take a string path parameter, and add it to the Path property.

  2. Specify Single for MessageQueueTransactionType in Send methods that take that parameter.

The .NET Compact Framework does not support the following types in the System.Messaging namespace:

AccessControlEntry

AccessControlEntryType

AccessControlList

ActiveXMessageFormatter

BinaryMessageFormatter

CryptographicProviderType

Cursor

EncryptionAlgorithm

EncryptionRequired

GenericAccessRights

HashAlgorithm

MessageLookupAction

MessageQueueAccessControlEntry

MessageQueueAccessRights

MessageQueueCriteria

MessageQueueEnumerator

MessageQueueInstaller

MessageQueuePermission

MessageQueuePermissionAttribute

MessageQueuePermissionEntry

MessageQueuePermissionEntryCollection

MessageQueueTransaction

MessageQueueTransactionStatus

MessagingDescriptionAttribute

PeekAction

QueueAccessMode

StandardAccessRights

Trustee

TrusteeType

See Also

Tasks

How to: Use MSMQ in the .NET Compact Framework
MSMQ Book Order Application Sample
MSMQ Book Order Application Sample

Concepts

Message Queues and Messaging Technology Backgrounder