Getting Started
Architecture
NServiceBus
Transports
Persistence
Hosting
ServiceInsight
ServicePulse
ServiceControl
Monitoring
Modernization
Samples

Overview

For a guided introduction to essential NServiceBus concepts start with the NServiceBus step-by-step tutorial.

The samples are designed to highlight how various features of NServiceBus work and how the extension points plug into other libraries and tooling. See about the samples for important information about the samples and the code contained within them.

The samples are located in GitHub at Particular/docs.particular.net/samples and both issues and pull requests are accepted.

Samples

  • Aspire Samples
  • AsyncAPI
  • AWS
  • Azure Samples
  • Azure Functions
    Samples showing how to host NServiceBus within an Azure Function.
  • Azure Service Bus transport
  • Bridge samples
  • Cosmos DB
  • Data Bus Samples
  • Dependency Injection Samples
  • Encryption samples
  • Hosting Samples
  • IBM MQ Transport Samples
  • Logging and Metrics Samples
  • MongoDB Samples
    • MongoDB Persistence
      Learn how to use MongoDB as a persistence mechanism for NServiceBus, including saga and timeout storage.
  • Multi-tenant Samples
  • NHibernate Persistence Samples
  • OpenTelemetry Samples
  • Outbox Samples
    • Using Outbox with CosmosDB
      Demonstrates how the Outbox handles duplicate messages using RabbitMQ and CosmosDb hosted in Docker containers.
    • Using Outbox with MongoDB
      Demonstrates how the Outbox handles duplicate messages using RabbitMQ and MongoDB hosted in Docker containers.
    • Using Outbox with RabbitMQ
      Demonstrates how the Outbox handles duplicate messages using RabbitMQ and SQL Server hosted in Docker containers.
    • Using Outbox with SQL Server
      A sample demonstrating the SQL Server transport with SQL Persistence and ADO.NET user data store using outbox.
  • Pipeline Samples
  • ServicePlatform Connection Samples
  • PostgreSQL Transport Samples
    • Simple PostgreSQL transport usage
      Learn how to configure NServiceBus with the PostgreSQL transport to send commands and publish events between endpoints using native publish-subscribe.
  • Publish/Subscribe
    Sample code related to publish/subscribe.
  • RabbitMQ Transport Samples
  • RavenDB Persistence Samples
  • Routing Samples
    Sample code related to routing.
  • Saga Samples
  • Scheduling Samples
    • Hangfire Usage
      Using Hangfire to send messages from within an NServiceBus endpoint.
    • PeriodTimer usage
      Using PeriodicTimer in a BackgroundJob to send messages from within an NServiceBus endpoint.
    • Quartz.NET Usage
      Using Quartz.NET to send messages from within an NServiceBus endpoint.
    • Scheduling with Timers
      An example of scheduling using .NET Timers.
  • Serializer Samples
  • ServiceControl Samples
  • Showcase Samples
    More complex samples showing many features working together.
    • Cinema Showcase
      A sample for a fictional cinema demonstrating a saga that aggregates ticket sales.
    • On-Premises Showcase
      Implements a fictional store using several features of NServiceBus.
  • SQL Persistence Samples
  • SQL Server Transport Samples
  • Transactional Session Samples
  • Web Samples