NServiceBus relies on a few key pieces of infrastructure in order to run properly. This page gives an overview of the requirements for running NServiceBus on the Windows platform.
NServiceBus works on top of existing queuing systems to provide the reliable communications that has become the trademark of NServiceBus. By default MSMQ is used which is the queuing system that comes with every installation of Windows. Configuring NServiceBus via the PlatformInstaller will configure MSMQ automatically. But when installing manually do not enable the following components:
- MSMQ Active Directory Domain Services Integration
- MSMQ Http Support
- MSMQ Triggers
- Multicasting Support
- MSMQ DCOM Proxy
These components can cause issues with the addressing used in NServiceBus.
In order to support guaranteed once delivery of messages NServiceBus makes use of the Distributed Transaction Coordinator (DTC) to synchronize transactions between the queuing system and the database. For this to work correctly the DTC must be started and configured correctly.
In Versions 5 and above of NServiceBus there is a non-DTC mode of operation available. In this mode NServiceBus uses a concept of outbox, a message store backed by same DB as the user code, to temporarily store messages that need to be sent as a result of processing an incoming message. To read more about this subject see Outbox.
In order to durably handle things like subscriptions, timeouts, and sagas, NServiceBus needs a storage mechanism that supports the DTC (or when in non-DTC mode, uses the same DB as the user code). The default storage for NServiceBus 3 and 4 was RavenDB with an option of using relational databases via NHibernate. Since Version 5 there is no default storage and a user has to explicitly choose either RavenDB, NHibernate or non-durable.
NServiceBus 3.3.0 introduced a set of PowerShell commandlets that were bundled with the binaries and could be used to automate setup of production servers.
These PowerShell commandlets are now available as a standalone installation.