Administration Differences

Windows CE implements an independent client that is not part of any domain. It therefore cannot be configured or accessed using standard desktop tools such as MSMQ Explorer. All relevant administration information is stored on the device itself and administration functions are carried out locally using the MSMQAdm utility. MSMQAdm is a utility that configures MSMQ. It supports scripting, enabling you to automate routine tasks.

The entire persistent state of MSMQ is a combination of information in the MSMQ registry key and MSMQ base directory.

The base registry key is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\SimpleClient. The following table shows the named values for the base registry MSMQ configuration parameters.

Value
Description
Port The machine port. This port is always set to 1,801 by the registration utility. Do not change the port setting.
PingPort The machine ping port. This ping port is always set to 3,527 by the registration utility. Do not change the ping port setting.
DefaultQuota The queue quota for message storage by a remote queue. If this value does not exist, outgoing queues are unrestricted.
QueueManagerGUID The globally unique identifier (GUID) of the Windows CE queue manager, used for session protocols between Windows CE and Windows NT implementations.
OutFRSQueue The outgoing FRS queue format name. This name must be DIRECT. If it is not, the outgoing FRS queue will not configure.
DebugQueue The queue used for routing debugging.
BaseDir The directory used for queue information and message storage.
HostName The machine host name. If this is not set, information is queried dynamically from the network.
MessageID The current message identifier, accurate within 1,000 messages. This identifier is set and used by the MSMQ client. This identifier should not be changed by a user.
CEStartAtBoot Windows CE-specific entry. If this value is a 0 DWORDentry, MSMQ will not start at boot time, but instead can be started using the MSMQ administration utility.

The base directory contains both local and outgoing queue and message data as well as MSMQ internal queues. There is one file contained in each queue. At startup, MSMQ creates a machine journal queue and a dead letter queue, if they are not already present. These queues have a local queue manager GUID as part of their names. Files with extensions "oq" contain ougoing messages, ones that were sent to queues on different machines. Files with extensions "iq" contain local queues and messages residing in these queues. Files with extensions "jq" contain journal counterparts to local queues. File names are prefixed with the machine name and "public" token for public queues. The exception is local queues, which are prefixed with the "$localhost$" token and cannot be public.

Configuration information should be present for MSMQ to start at boot time. If the registry key is not configured, MSMQ starts in a suspended state. After configuration has completed, you can start MSMQ using the MSMQAdm utility.

Note You must configure MSMQ after you set the computer name and current time. Current time is used for the generation of the GUID. If not set properly, more than one machine can end up with the same GUID, which may lead to unpredictable results. This is why configuration is not automatically done during the first cold boot; instead, it is left to the user to accomplish.

To use MSMQAdm, run it with its command as an argument. The following example shows how to run MSMQAdm in both automatic and manual modes.

Msmqadm <command>
Msmqadm man

MSMQAdm displays a prompt so that you can type commands interactively. To get list of commands, type the following command.

Msmqadm help

The following table describes some additional commands you can use.

Command
Description
Man <filename> Executes a script from a file
Exit Exits manual mode
Enum queues Displays a list of queues present on a device
Enum messages <queue number> Enumerates messages in a specified queue
Delete queue <queue number> Deletes a queue
Delete message <message number> Deletes a message
Purge queue <queue number> Purges a queue and deletes all messages
Start Starts the MSMQ service
Stop Stops the MSMQ service
Register {GUID} Creates the MSMQ configuration in the registry. The optional GUID specifies the GUID of the queue manager
Status Provides the status of the queue manager
Net connect Forces all queues to connect to the network
Net disconnect Abandons all network connections
Tidy Forces the system to perform an internal data compaction

The following three examples show how to set up and start MSMQ on the new device. Enter the commands from the command prompt.

\> msmqadm register
\> msmqadm start

or

\> msmqadm man
>register
>start
>exit
\>

or

\> echo register > start.txt
\> echo start >> start.txt
\> echo exit >> start.txt
\> msmqadm man start.txt
\>