Getting Started
Architecture
NServiceBus
Transports
Persistence
ServiceInsight
ServicePulse
ServiceControl
Monitoring
Samples

Simple MSMQ Transport usage

Component: MSMQ Transport
NuGet Package: NServiceBus.Transport.Msmq (2.x)
Target Version: NServiceBus 8.x

Prerequisites

Ensure that MSMQ has been installed.

Code walk-through

This sample shows basic usage of MSMQ as a transport for NServiceBus. The application sends an empty message to itself and writes to the console when the message is received.

Configuration

var endpointConfiguration = new EndpointConfiguration("Samples.Msmq.Simple");
endpointConfiguration.UseTransport(new MsmqTransport());

Other settings such as usage of dead-letter queues, journaling, etc., can be configured using the configuration API.

Related Articles

  • MSMQ Transport
    MSMQ is a solid durable communications technology but does not dynamically detect network interfaces.