MSMQ Transport

MSMQ is the default transport used by NServiceBus.

NServiceBus Configuration

NServiceBus requires a specific MSMQ configuration to operate.

The supported configuration is to only have the base MSMQ service installed with no optional features. To enable the supported configuration either use NServiceBus Prerequisites in the Platform Installer or use the Install-NServiceBusMSMQ cmdlet from the NServiceBus PowerShell Module.

Alternatively the MSMQ service can be manually installed by following these Operating System specific instructions:

Windows 7

From the Control Panel, choose Programs Then run the Windows Features Wizard by click on Turn Windows Features On or Off. Enable Microsoft Message Queue (MSMQ) Server Core. All other MSMQ sub-options should be disabled.

The DISM command line equivalent is:

DISM.exe /Online /NoRestart /English /Enable-Feature /FeatureName:MSMQ-Container /FeatureName:MSMQ-Server

Windows 8.x and 10

From the Control Panel, choose Programs. Then run the Windows Features Wizard by click on Turn Windows Features On or Off. Enable Microsoft Message Queue (MSMQ) Server Core. All other MSMQ sub-options should be disabled.

The DISM command line equivalent is:

DISM.exe /Online /NoRestart /English /Enable-Feature /all /FeatureName:MSMQ-Server

Windows 2008 R2 and Windows 2012

From Server Manager's Add Roles and Features Wizard enable Message Queue Server. All other MSMQ options should be disabled.

The DISM command line equivalent is:

DISM.exe /Online /NoRestart /English /Enable-Feature /all /FeatureName:MSMQ-Server

MSMQ clustering

MSMQ clustering works by having the active node running the instance of the MSMQ service and the other nodes being cold standbys. On failover, a new instance of the MSMQ service has to be loaded from scratch. All active network connections and associated queue handles break and have to be reconnected. Any transactional processing of messages aborts, returning the message to the queue after startup.

So downtime is proportional to the time taken for the MSMQ service to restart on another node. This is affected by how many messages are in currently storage, awaiting processing.

Remote Queues

Remote queues are not supported for MSMQ as this conflicts with the Distributed Bus architectural style that is predicated on consents of durability, autonomy and avoiding a single point of failure. For scenarios where a Broker Bus style architecture is required use transports like Sql Server and RabbitMQ.

Samples

Related Articles

Scaling out MSMQ endpoints

How to scale out when using the MSMQ transport.


Last modified