NServiceBus Home

FAQ Contents

MsmqTransportConfig

This configuration section defines properties of the MSMQ transport. For some background on MSMQ, see here. Here's an example MsmqTransportConfig:

<MsmqTransportConfig ErrorQueue="error" NumberOfWorkerThreads="1" MaxRetries="5"/>

ErrorQueue

Beginning NServiceBus V3, the following configuration section should be used to declare an error queue:

    <section name="MessageForwardingInCaseOfFaultConfig" 
    type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />

And the value for that is defined as follows:

    <MessageForwardingInCaseOfFaultConfig ErrorQueue="error"/>

The ErrorQueue in n MsmqTransportConfig is there for compatibility reasons with earlier versions.

The ErrorQueue defines the name of the queue to which messages will be transferred if they could not be processed successfully. This may be a queue on the local machine, or an a remote machine - in which case, the value should be based on the template "queueName@remoteMachineName" where "queueName" is the name of the error queue (often "error") and "remoteMachineName" is the name of the remote machine on which the error queue resides.

If no error queue is defined, NServiceBus will fail to start, with an "Could not find backup configuration section 'MsmqTransportConfig' in order to locate the error queue." exception:

You can read more about messages whose processing fails here.

NumberOfWorkerThreads

This property dictates the number of threads that will be receiving messages from the input queue. This property has no impact on the number of threads that can use the bus to send or publish messages.

MaxRetries

This property is related to the ErrorQueue property - it defines the number of times that a message whose processing has failed will be tried again before it is moved to the error queue.

If you do not provide a value here, it will default to 5.

Legal

“NServiceBus” is among the trademarks of NServiceBus Ltd. All other product and company names and marks mentioned are the property of their respective owners and are mentioned for identification purposes only.

© 2010-2012 NServiceBus Ltd. All rights reserved.