C# Class NServiceBus.MsmqConfigurationExtensions

Adds extensions methods to TransportExtensions{T} for configuration purposes.
Show file Open project: Particular/NServiceBus

Public Methods

Method Description
ApplyLabelToMessages ( this transportExtensions, string>.Func labelGenerator ) : TransportExtensions

Set a delegate to use for applying the Message.Label property when sending a message.

This delegate will be used for all valid messages sent via MSMQ. This includes, not just standard messages, but also Audits, Errors and all control messages. In some cases it may be useful to use the Headers.ControlMessageHeader key to determine if a message is a control message. The only exception to this rule is received messages with corrupted headers. These messages will be forwarded to the error queue with no label applied.

InstanceMappingFile ( this config ) : InstanceMappingFileSettings

Returns the configuration options for the file based instance mapping file.

SetMessageDistributionStrategy ( this config, DistributionStrategy distributionStrategy ) : void

Sets a distribution strategy for a given endpoint.

TransactionScopeOptions ( this transportExtensions, System.TimeSpan timeout = null, IsolationLevel isolationLevel = null ) : TransportExtensions

Allows to change the transaction isolation level and timeout for the `TransactionScope` used to receive messages.

If not specified the default transaction timeout of the machine will be used and the isolation level will be set to `ReadCommited`.

Method Details

ApplyLabelToMessages() public static method

Set a delegate to use for applying the Message.Label property when sending a message.
This delegate will be used for all valid messages sent via MSMQ. This includes, not just standard messages, but also Audits, Errors and all control messages. In some cases it may be useful to use the Headers.ControlMessageHeader key to determine if a message is a control message. The only exception to this rule is received messages with corrupted headers. These messages will be forwarded to the error queue with no label applied.
public static ApplyLabelToMessages ( this transportExtensions, string>.Func labelGenerator ) : TransportExtensions
transportExtensions this
labelGenerator string>.Func
return TransportExtensions

InstanceMappingFile() public static method

Returns the configuration options for the file based instance mapping file.
public static InstanceMappingFile ( this config ) : InstanceMappingFileSettings
config this
return InstanceMappingFileSettings

SetMessageDistributionStrategy() public static method

Sets a distribution strategy for a given endpoint.
public static SetMessageDistributionStrategy ( this config, DistributionStrategy distributionStrategy ) : void
config this Config object.
distributionStrategy DistributionStrategy The instance of a distribution strategy.
return void

TransactionScopeOptions() public static method

Allows to change the transaction isolation level and timeout for the `TransactionScope` used to receive messages.
If not specified the default transaction timeout of the machine will be used and the isolation level will be set to `ReadCommited`.
public static TransactionScopeOptions ( this transportExtensions, System.TimeSpan timeout = null, IsolationLevel isolationLevel = null ) : TransportExtensions
transportExtensions this
timeout System.TimeSpan
isolationLevel IsolationLevel
return TransportExtensions