## Overview - [Overview](https://docs.particular.net/samples/index.md): Samples using NServiceBus and the Particular Service Platform. ## General - [Callback Usage](https://docs.particular.net/samples/callbacks/index.md): Demonstrates the use of callbacks. - [Consumer-driven Contracts sample](https://docs.particular.net/samples/consumer-driven-contracts/index.md): NServiceBus sample that shows a consumer-driven contract (CDC) approach to messaging. (supported: [6.0.0, )) - [Cooperative cancellation](https://docs.particular.net/samples/cooperative-cancellation/index.md): Stopping both the endpoint and a long running handler with a cancellation token. - [Custom Recoverability](https://docs.particular.net/samples/custom-recoverability/index.md): Custom Recoverability Messaging Policy approaches to help with failure scenarios. - [Delayed Delivery](https://docs.particular.net/samples/delayed-delivery/index.md): A simple ordering system that defers handling or delivery of a message. - [Entity Framework Core integration with SQL Persistence](https://docs.particular.net/samples/entity-framework-core/index.md): Integrating Entity Framework Core with SQL Persistence. - [Automatic Retries](https://docs.particular.net/samples/errorhandling/index.md): Shows immediate and delayed retries when a handler throws an exception. - [Fault Tolerance](https://docs.particular.net/samples/faulttolerance/index.md): Messaging approaches to help with failure scenarios. - [Building a custom feature](https://docs.particular.net/samples/feature/index.md): How to build a custom feature in NServiceBus. - [Full Duplex](https://docs.particular.net/samples/fullduplex/index.md): Using full-duplex and request/response communication. - [Gateway](https://docs.particular.net/samples/gateway/index.md) - [Header Manipulation](https://docs.particular.net/samples/header-manipulation/index.md): All extension points for mutating messages. - [Immutable Messages samples](https://docs.particular.net/samples/immutable-messages/index.md): Demonstrate how to use immutable messages when exchanging messages between endpoints. - [Sharing message assemblies](https://docs.particular.net/samples/message-assembly-sharing/index.md): Demonstrate how the NServiceBus.MessageInterfaces package enables message assemblies to be shared across major versions of NServiceBus. - [Message Mutators](https://docs.particular.net/samples/messagemutators/index.md): Change messages by plugging custom logic in to a couple of interfaces, encrypting as required. - [Near Real-Time Occasionally-Connected Clients](https://docs.particular.net/samples/near-realtime-clients/index.md): How to relay NServiceBus events to occasionally-connected clients via SignalR. - [Non-Durable Transport Usage](https://docs.particular.net/samples/non-durable-transport/index.md): Demonstrates two co-located endpoints sharing a non-durable broker, with inline execution, non-durable persistence, and saga timeouts. - [Performance Counter Usage](https://docs.particular.net/samples/performance-counters/index.md): Using the built-in Performance Counters. - [Unit Testing a custom recoverability policy](https://docs.particular.net/samples/recoverabilitypolicytesting/index.md): Writing unit tests for custom recoverability policies. - [SQL Server Transport and NHibernate Persistence](https://docs.particular.net/samples/sqltransport-nhpersistence/index.md): Integrating SQL Server transport with NHibernate persistence. - [SQL Server Transport and SQL Persistence](https://docs.particular.net/samples/sqltransport-sqlpersistence/index.md): Integrating the SQL Server transport with SQL persistence. - [Message Throughput Throttling](https://docs.particular.net/samples/throttling/index.md) - [Unit Testing NServiceBus](https://docs.particular.net/samples/unit-testing/index.md): Writing unit tests for NServiceBus systems. - [Unobtrusive](https://docs.particular.net/samples/unobtrusive/index.md): Demonstrates NServiceBus operating in unobtrusive mode. - [Versioning](https://docs.particular.net/samples/versioning/index.md): Message evolution over time using interfaces. ## Aspire - [Aspire Samples](https://docs.particular.net/samples/aspire/index.md) - [Particular Platform in Aspire](https://docs.particular.net/samples/aspire/platform/index.md): Minimal orchestrating the Particular Platform via Aspire. - [Particular Platform with ASB in Aspire](https://docs.particular.net/samples/aspire/platform-asb/index.md): Orchestrating the Particular Platform with Azure ServiceBus transport via Aspire. - [Particular Platform with RabbitMQ in Aspire](https://docs.particular.net/samples/aspire/platform-rabbitmq/index.md): Orchestrating the Particular Platform with RabbitMQ transport via Aspire. - [Particular Platform with SQL Server in Aspire](https://docs.particular.net/samples/aspire/platform-sqlserver/index.md): Orchestrating the Particular Platform with SQL Server transport via Aspire. - [Particular Platform with Amazon SQS in Aspire](https://docs.particular.net/samples/aspire/platform-sqs/index.md): Orchestrating the Particular Platform with Amazon SQS transport via Aspire. ## AsyncAPI - [AsyncAPI](https://docs.particular.net/samples/asyncapi/index.md) - [AsyncAPI with custom message conventions](https://docs.particular.net/samples/asyncapi/custom-message-types/index.md): How to generate an AsyncAPI schema document from NServiceBus with custom message conventions. - [Simple AsyncAPI](https://docs.particular.net/samples/asyncapi/simple/index.md): How to generate an AsyncAPI schema document from NServiceBus. ## AWS - [AWS](https://docs.particular.net/samples/aws/index.md) - [AmazonSQS CloudEvents Sample](https://docs.particular.net/samples/aws/cloud-events/index.md): Demonstrates how to consume CloudEvents received through Amazon SQS. - [Simple DynamoDB Persistence Usage](https://docs.particular.net/samples/aws/dynamodb-simple/index.md): Using DynamoDB Persistence to store sagas. - [DynamoDB Persistence Usage with transactions](https://docs.particular.net/samples/aws/dynamodb-transactions/index.md): Using DynamoDB persistence to store sagas and outbox records atomically. - [Using NServiceBus in AWS Lambda with SQS](https://docs.particular.net/samples/aws/lambda-sqs/index.md) - [Using NServiceBus in AWS Lambda with annotations and SQS](https://docs.particular.net/samples/aws/lambda-sqs-annotations/index.md) - [Using NServiceBus Sagas with AWS Lambda, SQS, and DynamoDB](https://docs.particular.net/samples/aws/sagas/index.md): A sample demonstrating the AWS DynamoDB persistence, AWS Lambda, and AWS SQS with NServiceBus sagas. - [Using NServiceBus Sagas with AWS Lambda, SQS, and Aurora](https://docs.particular.net/samples/aws/sagas-lambda-aurora/index.md): A sample demonstrating the AWS Aurora persistence, AWS Lambda, and AWS SQS with NServiceBus sagas. - [AmazonSQS transport native integration sample](https://docs.particular.net/samples/aws/sqs-native-integration/index.md) - [Simple AmazonSQS Transport usage](https://docs.particular.net/samples/aws/sqs-simple/index.md) ## Azure - [Azure Samples](https://docs.particular.net/samples/azure/index.md) - [Custom audit transport](https://docs.particular.net/samples/azure/custom-audit-transport/index.md): Azure Service Bus endpoint with audit via Azure Storage Queue. - [Azure Storage Queues transport native integration sample](https://docs.particular.net/samples/azure/native-integration-asq/index.md): Consuming messages sent by non-NServiceBus endpoints with the Azure Storage Queues transport. - [Azure Storage Queues Transport](https://docs.particular.net/samples/azure/storage-queues/index.md) - [Self-Hosting in Azure WebJobs](https://docs.particular.net/samples/azure/webjob-host/index.md): Host an NServiceBus endpoint in Azure WebJobs. - [Azure Table Persistence Using Saga IDs as Partition Keys](https://docs.particular.net/samples/azure/azure-table/saga-transactions/index.md): Using Saga IDs as partition keys in Azure Table Persistence to store sagas and outbox records atomically. - [Simple Azure Table Persistence Usage](https://docs.particular.net/samples/azure/azure-table/simple/index.md): Using Azure Table Persistence to store sagas. - [AzureTable Persistence Usage with non-default table](https://docs.particular.net/samples/azure/azure-table/table/index.md): Using Azure Table Persistence to store sagas providing a non-default table dynamically. - [Azure Table Persistence Usage with Transactions](https://docs.particular.net/samples/azure/azure-table/transactions/index.md): Using Azure Table Persistence to store sagas and outbox records atomically. ## Azure Functions - [Azure Functions](https://docs.particular.net/samples/azure-functions/index.md): Samples showing how to host NServiceBus within an Azure Function. - [Using NServiceBus in Azure Functions](https://docs.particular.net/samples/azure-functions/service-bus/index.md): Using NServiceBus with Azure Service Bus triggers and Azure Functions hosting. - [Using NServiceBus and Kafka in Azure Functions (isolated)](https://docs.particular.net/samples/azure-functions/service-bus-kafka/index.md): Using NServiceBus with Kafka triggers and Azure Functions isolated worker hosting model. - [Using NServiceBus in Azure Functions (isolated worker)](https://docs.particular.net/samples/azure-functions/service-bus-worker/index.md): Using NServiceBus with Azure Service Bus triggers and Azure Functions isolated worker hosting model. ## Azure Service Bus transport - [Azure Service Bus transport](https://docs.particular.net/samples/azure-service-bus-netstandard/index.md) - [Azure Service Bus CloudEvents Sample](https://docs.particular.net/samples/azure-service-bus-netstandard/cloud-events/index.md): Demonstrates how to consume CloudEvents received through Azure Service Bus. - [Azure Service Bus Hierarchy Namespace Sample](https://docs.particular.net/samples/azure-service-bus-netstandard/hierarchy-namespace/index.md): Demonstrates how to use hierarchical namespaces with Azure Service Bus. - [Azure Service Bus KeyVault Sample](https://docs.particular.net/samples/azure-service-bus-netstandard/key-vault/index.md): Demonstrates how to use KeyVault to store connection string to the Azure Service Bus. - [Azure Service Bus transport native integration sample](https://docs.particular.net/samples/azure-service-bus-netstandard/native-integration/index.md): How to consume messages published by non-NServiceBus endpoints. - [Azure Service Bus Pub/Sub Native Integration](https://docs.particular.net/samples/azure-service-bus-netstandard/native-integration-pub-sub/index.md): How to consume event messages published by non-NServiceBus endpoints. - [Azure Service Bus Topology Options](https://docs.particular.net/samples/azure-service-bus-netstandard/options/index.md): How to use topology options to layout the topic topology in app settings. - [Build message-driven business applications with NServiceBus](https://docs.particular.net/samples/azure-service-bus-netstandard/send-receive-with-nservicebus/index.md): Build message-driven business applications with NServiceBus and Azure Service Bus. - [Azure Service Bus Send/Reply Sample](https://docs.particular.net/samples/azure-service-bus-netstandard/send-reply/index.md): Demonstrates the send/reply pattern with Azure Service Bus. - [Azure Service Bus topology migration](https://docs.particular.net/samples/azure-service-bus-netstandard/topology-migration/index.md): Demonstrates how to migrate from the single-topic to topic-per-event topology. ## Bridge samples - [Bridge samples](https://docs.particular.net/samples/bridge/index.md) - [Bridge messages between endpoints using MSMQ and Azure Service Bus](https://docs.particular.net/samples/bridge/azure-service-bus-msmq-bridge/index.md): A sample showing how to send messages between endpoints using different transports using NServiceBus Messaging Bridge. - [Use Bridge to connect to ServiceControl running on different transport](https://docs.particular.net/samples/bridge/service-control/index.md): Centralize monitoring of mixed transport solution with the Bridge. - [Simple Bridge Usage](https://docs.particular.net/samples/bridge/simple/index.md): How to use the NServiceBus messaging bridge to connect endpoints on different transports. - [Multi-Instance Mode](https://docs.particular.net/samples/bridge/sql-multi-instance/index.md): SQL Server transport running in multi-instance mode using Bridge. ## Cosmos DB - [Cosmos DB](https://docs.particular.net/samples/cosmosdb/index.md) - [Cosmos DB Persistence Usage with non-default container](https://docs.particular.net/samples/cosmosdb/container/index.md): Using Cosmos DB Persistence to store sagas providing a non-default container dynamically. - [Cosmos DB Persistence Usage with Encryption](https://docs.particular.net/samples/cosmosdb/encryption/index.md): Using Cosmos DB Persistence to store sagas with encryption. - [Simple Cosmos DB Persistence Usage](https://docs.particular.net/samples/cosmosdb/simple/index.md): Using Cosmos DB Persistence to store sagas. - [Cosmos DB Persistence Usage with transactions](https://docs.particular.net/samples/cosmosdb/transactions/index.md): Using Cosmos DB Persistence to store sagas and outbox records atomically. ## Data Bus - [Data Bus Samples](https://docs.particular.net/samples/databus/index.md) - [Azure Blob Storage DataBus](https://docs.particular.net/samples/databus/blob-storage-databus/index.md): Sending large attachments with NServiceBus over Azure blob storage. - [Azure Blob Storage Data Bus Cleanup with Azure Functions](https://docs.particular.net/samples/databus/blob-storage-databus-cleanup-function/index.md): Using an Azure Function instead of the built in blob cleanup capabilities. - [Custom Serializer for Data Bus](https://docs.particular.net/samples/databus/custom-serializer/index.md): Send a message that includes a DataBus property serialized using a custom serializer. - [Databus with SystemJsonSerializer message serializer](https://docs.particular.net/samples/databus/databus-custom-serializer-converter/index.md): The file share data bus allows large properties to be transferred via a Windows file share using custom converter for SystemJsonSerializer. - [File Share Data Bus Usage](https://docs.particular.net/samples/databus/file-share-databus/index.md): The file share data bus allows large properties to be transferred via a Windows file share. - [Redis claim check](https://docs.particular.net/samples/databus/redis/index.md): Implementing the claim check pattern with Redis. ## Dependency Injection - [Dependency Injection Samples](https://docs.particular.net/samples/dependency-injection/index.md) - [ASP.NET Core Dependency Injection Integration](https://docs.particular.net/samples/dependency-injection/aspnetcore/index.md) - [Externally Managed Mode](https://docs.particular.net/samples/dependency-injection/externally-managed-mode/index.md): A sample that uses the externally managed mode feature to configure a dependency injection container. (supported: (, 10.0.0)) ## Encryption samples - [Encryption samples](https://docs.particular.net/samples/encryption/index.md) - [Message property encryption](https://docs.particular.net/samples/encryption/basic-encryption/index.md): Encrypting specific parts of a message using the message property encryption feature. - [Unobtrusive property encryption](https://docs.particular.net/samples/encryption/encryption-conventions/index.md): Encrypting specific parts of a message using conventions. - [Message body encryption](https://docs.particular.net/samples/encryption/message-body-encryption/index.md): Encrypting the full message body using a mutator. ## Hosting - [Hosting Samples](https://docs.particular.net/samples/hosting/index.md) - [Hosting endpoints in Docker Linux containers](https://docs.particular.net/samples/hosting/docker/index.md): Hosting multiple endpoints in several Docker Linux containers managed by Docker Compose. - [Endpoint hosting with the Generic Host](https://docs.particular.net/samples/hosting/generic-host/index.md): Hosting an endpoint with the Microsoft Generic Host. ## IBM MQ Transport - [IBM MQ Transport Samples](https://docs.particular.net/samples/ibmmq/index.md) - [IBM MQ EBCDIC interoperability](https://docs.particular.net/samples/ibmmq/ebcdic/index.md): Receiving fixed-length EBCDIC-encoded messages from a legacy mainframe system via IBM MQ. - [IBM MQ polymorphic event routing](https://docs.particular.net/samples/ibmmq/polymorphic-events/index.md): Demonstrating explicit subscription routing so that a handler for a base event type receives messages published as derived types. - [IBM MQ simple sender/receiver](https://docs.particular.net/samples/ibmmq/simple/index.md): Sending commands from a send-only endpoint to a receiving endpoint using the IBM MQ transport. ## Logging and Metrics - [Logging and Metrics Samples](https://docs.particular.net/samples/logging/index.md) - [Capture and visualize metrics using Datadog](https://docs.particular.net/samples/logging/datadog/index.md): Illustrates how to capture, store, and visualize NServiceBus metrics in Datadog. - [NServiceBus.Extensions.Logging Usage](https://docs.particular.net/samples/logging/extensions-logging/index.md): A sample that uses Microsoft.Extensions.Logging with NLog. - [Write metrics to the trace log](https://docs.particular.net/samples/logging/metrics/index.md): How to write metrics information to the trace log. - [Capture and visualize metrics using NewRelic](https://docs.particular.net/samples/logging/new-relic/index.md): Illustrates how to capture, store, and visualize NServiceBus metrics in NewRelic. - [Notifications](https://docs.particular.net/samples/logging/notifications/index.md) ## MongoDB - [MongoDB Samples](https://docs.particular.net/samples/mongodb/index.md) - [MongoDB Persistence](https://docs.particular.net/samples/mongodb/simple/index.md): Learn how to use MongoDB as a persistence mechanism for NServiceBus, including saga and timeout storage. ## Multi-tenant - [Multi-tenant Samples](https://docs.particular.net/samples/multi-tenant/index.md) - [Injecting tenant-aware components into message handlers](https://docs.particular.net/samples/multi-tenant/di/index.md): How to configure IoC to inject tenant-aware components into message handlers. - [NHibernate persistence in multi-tenant systems](https://docs.particular.net/samples/multi-tenant/nhibernate/index.md): Configure NHibernate persistence to support multi-tenant scenarios. - [Propagating Tenant Information to Downstream Endpoints](https://docs.particular.net/samples/multi-tenant/propagation/index.md): How to configure the pipeline to propagate tenant information to downstream endpoints automatically. - [RavenDB Persistence in multi-tenant systems](https://docs.particular.net/samples/multi-tenant/ravendb/index.md): Configure RavenDB Persistence to support multi-tenant scenarios. - [SQL Persistence in multi-tenant system](https://docs.particular.net/samples/multi-tenant/sqlp/index.md): Configure SQL Persistence to support multi-tenant scenarios. ## NHibernate Persistence - [NHibernate Persistence Samples](https://docs.particular.net/samples/nhibernate/index.md) - [NServiceBus.NHibernate custom saga mapping sample](https://docs.particular.net/samples/nhibernate/custom-mappings/index.md): An NServiceBus sample demonstrating a custom saga mapping to change how NHibernate creates the database schema using different techniques. - [Simple NHibernate Persistence Usage](https://docs.particular.net/samples/nhibernate/simple/index.md): Using NHibernate to store saga data and business data. ## OpenTelemetry - [OpenTelemetry Samples](https://docs.particular.net/samples/open-telemetry/index.md) - [Monitoring NServiceBus endpoints with Application Insights](https://docs.particular.net/samples/open-telemetry/application-insights/index.md): How to configure NServiceBus to export OpenTelemetry traces and meters to Application Insights. - [Customizing OpenTelemetry tracing](https://docs.particular.net/samples/open-telemetry/customizing/index.md): Demonstrates how to add data to existing OpenTelemetry traces. - [Monitoring NServiceBus endpoints with Jaeger](https://docs.particular.net/samples/open-telemetry/jaeger/index.md): How to configure NServiceBus to export OpenTelemetry traces to Jaeger. - [Connecting OpenTelemetry traces and logs](https://docs.particular.net/samples/open-telemetry/logging/index.md): How to connect OpenTelemetry traces to logs in an NServiceBus endpoint. - [Capturing message properties as OpenTelemetry span tags](https://docs.particular.net/samples/open-telemetry/message-tags/index.md): Demonstrates how to use pipeline behaviors to capture specific values from message body properties and headers as tags on OpenTelemetry spans. - [Use a shim to expose NServiceBus.Metrics via OpenTelemetry](https://docs.particular.net/samples/open-telemetry/metrics-shim/index.md): How to set up a shim to expose NServiceBus.Metrics via OpenTelemetry. - [Monitoring NServiceBus endpoints with Prometheus and Grafana](https://docs.particular.net/samples/open-telemetry/prometheus-grafana/index.md): How to configure NServiceBus to export OpenTelemetry metrics to Prometheus and Grafana. ## Outbox - [Outbox Samples](https://docs.particular.net/samples/outbox/index.md) - [Using Outbox with CosmosDB](https://docs.particular.net/samples/outbox/cosmosdb/index.md): Demonstrates how the Outbox handles duplicate messages using RabbitMQ and CosmosDb hosted in Docker containers. - [Using Outbox with MongoDB](https://docs.particular.net/samples/outbox/mongodb/index.md): Demonstrates how the Outbox handles duplicate messages using RabbitMQ and MongoDB hosted in Docker containers. - [Using Outbox with RabbitMQ](https://docs.particular.net/samples/outbox/rabbit/index.md): Demonstrates how the Outbox handles duplicate messages using RabbitMQ and SQL Server hosted in Docker containers. - [Using Outbox with SQL Server](https://docs.particular.net/samples/outbox/sql/index.md): A sample demonstrating the SQL Server transport with SQL Persistence and ADO.NET user data store using outbox. ## Pipeline - [Pipeline Samples](https://docs.particular.net/samples/pipeline/index.md) - [Audit Filter Pipeline Extension](https://docs.particular.net/samples/pipeline/audit-filtering/index.md): Extending the pipeline to stop certain messages from being audited. - [Dispatch notification pipeline extension](https://docs.particular.net/samples/pipeline/dispatch-notifications/index.md): Extending the pipeline to fire a notification when messages are dispatched. - [Add feature toggles to handlers](https://docs.particular.net/samples/pipeline/feature-toggle/index.md): Checks feature toggles to determine whether or not a handler should be executed for a given message. - [Repair malformed messages using pipeline behavior](https://docs.particular.net/samples/pipeline/fix-messages-using-behavior/index.md): A sample showing how to repair malformed messages by implementing a pipeline behavior. - [Header propagation using the pipeline](https://docs.particular.net/samples/pipeline/header-propagation/index.md): How to use the pipeline to copy a header from incoming messages to outgoing messages. - [Consuming MassTransit messages with NServiceBus](https://docs.particular.net/samples/pipeline/masstransit-messages/index.md): Use the NServiceBus pipeline to consume messages sent by MassTransit. - [Message signing using NServiceBus pipeline behaviors](https://docs.particular.net/samples/pipeline/message-signing/index.md): Shows how to implement message signing and verification using NServiceBus pipeline behaviors. - [Session filter pipeline extension](https://docs.particular.net/samples/pipeline/session-filtering/index.md): How to extend the pipeline to filter out messages from older sessions. - [Unit of work using custom pipeline behavior](https://docs.particular.net/samples/pipeline/unit-of-work/index.md): How to use IoC and a pipeline behavior to create a custom unit of work implementation. ## ServicePlatform Connection - [ServicePlatform Connection Samples](https://docs.particular.net/samples/platform-connector/index.md) - [Connect to ServicePlatform with code-first configuration](https://docs.particular.net/samples/platform-connector/code-first/index.md): A sample that shows how to connect an NServiceBus endpoint to the Particular Service Platform using the code-first API. - [Connect to ServicePlatform with JSON configuration](https://docs.particular.net/samples/platform-connector/json/index.md): A sample that shows how to connect an NServiceBus endpoint to the Particular Service Platform using the JSON schema. - [Connect to ServicePlatform using the .NET Generic Host](https://docs.particular.net/samples/platform-connector/ms-config/index.md): A sample that shows how to connect an NServiceBus endpoint hosted in the .NET Generic Host to the Particular Service Platform. ## PostgreSQL Transport - [PostgreSQL Transport Samples](https://docs.particular.net/samples/postgresqltransport/index.md) - [Simple PostgreSQL transport usage](https://docs.particular.net/samples/postgresqltransport/simple/index.md): Learn how to configure NServiceBus with the PostgreSQL transport to send commands and publish events between endpoints using native publish-subscribe. ## Publish/Subscribe - [Publish/Subscribe](https://docs.particular.net/samples/pubsub/index.md): Sample code related to publish/subscribe. - [Native Publish/Subscribe](https://docs.particular.net/samples/pubsub/native/index.md): Publish/Subscribe with multicast-enabled transports. ## RabbitMQ Transport - [RabbitMQ Transport Samples](https://docs.particular.net/samples/rabbitmq/index.md) - [RabbitMQ transport native integration sample](https://docs.particular.net/samples/rabbitmq/native-integration/index.md): Consuming messages published by non-NServiceBus endpoints. - [Simple RabbitMQ Transport Usage](https://docs.particular.net/samples/rabbitmq/simple/index.md) ## RavenDB Persistence - [RavenDB Persistence Samples](https://docs.particular.net/samples/ravendb/index.md) - [Simple RavenDB Persistence Usage](https://docs.particular.net/samples/ravendb/simple/index.md): Using RavenDB to store Sagas. ## Routing - [Routing Samples](https://docs.particular.net/samples/routing/index.md): Sample code related to routing. - [Command routing](https://docs.particular.net/samples/routing/command-routing/index.md): Basic NServiceBus message routing. - [Message forwarding](https://docs.particular.net/samples/routing/message-forwarding/index.md): Forwarding a copy of every message to another destination after it is processed. ## Saga - [Saga Samples](https://docs.particular.net/samples/saga/index.md) - [Batch messages using sagas](https://docs.particular.net/samples/saga/batching/index.md): Use batching when generating tasks using sagas. - [NHibernate Custom Saga Finding Logic](https://docs.particular.net/samples/saga/nh-custom-sagafinder/index.md): Implement custom saga-finding behavior using custom query logic when saga data is stored in a relational database and accessed via the NHibernate ORM. - [Simple Saga Usage](https://docs.particular.net/samples/saga/simple/index.md): How build and use a saga. - [SQL Persistence Saga Finding Logic](https://docs.particular.net/samples/saga/sql-sagafinder/index.md): Perform custom saga finding logic based on custom queries when the Saga storage is the native SQL Persistence. ## Scheduling - [Scheduling Samples](https://docs.particular.net/samples/scheduling/index.md) - [Hangfire Usage](https://docs.particular.net/samples/scheduling/hangfire/index.md): Using Hangfire to send messages from within an NServiceBus endpoint. - [PeriodTimer usage](https://docs.particular.net/samples/scheduling/periodictimer/index.md): Using PeriodicTimer in a BackgroundJob to send messages from within an NServiceBus endpoint. - [Quartz.NET Usage](https://docs.particular.net/samples/scheduling/quartz/index.md): Using Quartz.NET to send messages from within an NServiceBus endpoint. - [Scheduling with Timers](https://docs.particular.net/samples/scheduling/timer/index.md): An example of scheduling using .NET Timers. ## Serializer - [Serializer Samples](https://docs.particular.net/samples/serializers/index.md) - [Avro Serializer sample](https://docs.particular.net/samples/serializers/avro/index.md): NServiceBus sample that shows how to use the Avro serializer in an endpoint. - [Multiple Deserializers](https://docs.particular.net/samples/serializers/multiple-deserializers/index.md): Using the AddDeserializer API to enable deserializing multiple formats. - [Newtonsoft JSON Serializer sample](https://docs.particular.net/samples/serializers/newtonsoft/index.md): NServiceBus sample that shows how to use the Newtonsoft JSON serializer in an endpoint. - [Newtonsoft BSON Serializer](https://docs.particular.net/samples/serializers/newtonsoft-bson/index.md): Using the Newtonsoft BSON serializer in an endpoint. - [System.Text.Json Serializer sample](https://docs.particular.net/samples/serializers/system-json/index.md): NServiceBus sample that shows how to use the builtin System.Text.Json serializer in an endpoint. - [Transition serialization formats](https://docs.particular.net/samples/serializers/transitioning-formats/index.md): An approach for introducing a breaking change to message serialization with no downtime. - [XML Serializer sample](https://docs.particular.net/samples/serializers/xml/index.md): NServiceBus sample that shows how to use the default NServiceBus XML serializer. ## ServiceControl - [ServiceControl Samples](https://docs.particular.net/samples/servicecontrol/index.md) - [Shipping the ServiceControl audit log to a SIEM with OpenTelemetry](https://docs.particular.net/samples/servicecontrol/audit-log-otlp/index.md): Export the ServiceControl authorization audit log over OTLP to an OpenTelemetry Collector and deliver it to a SIEM in Elastic Common Schema format. - [Monitor ServiceControl events with Azure Application Insights](https://docs.particular.net/samples/servicecontrol/azure-monitor-events/index.md): A sample showing how to monitor events published by ServiceControl with Azure Application Insights. - [Monitor with ServiceControl events](https://docs.particular.net/samples/servicecontrol/events-subscription/index.md): A sample showing how to monitor events in ServiceControl. - [Repair malformed messages using ServiceControl retry redirects](https://docs.particular.net/samples/servicecontrol/fix-messages/index.md): A sample showing how to repair malformed messages by redirecting them to a temporary endpoint. - [Monitor third-party systems with custom checks](https://docs.particular.net/samples/servicecontrol/monitoring3rdparty/index.md): Monitoring third-party systems which are exposed as HTTP endpoints with custom checks. - [Retry failed messages using ServicePulse](https://docs.particular.net/samples/servicecontrol/retry-messages/index.md): A sample showing how to retry failed messages. ## Showcase - [Showcase Samples](https://docs.particular.net/samples/showcase/index.md): More complex samples showing many features working together. - [Cinema Showcase](https://docs.particular.net/samples/showcase/cinema/index.md): A sample for a fictional cinema demonstrating a saga that aggregates ticket sales. - [On-Premises Showcase](https://docs.particular.net/samples/showcase/on-premises/index.md): Implements a fictional store using several features of NServiceBus. ## SQL Persistence - [SQL Persistence Samples](https://docs.particular.net/samples/sql-persistence/index.md) - [Injecting repository pattern services](https://docs.particular.net/samples/sql-persistence/injecting-services/index.md): Inject services into an endpoint that share the same DbConnection used by NServiceBus. - [SQL Persistence Saga Rename](https://docs.particular.net/samples/sql-persistence/saga-rename/index.md): Renaming a saga that is stored in the SQL Persistence. - [Simple SQL Persistence Usage](https://docs.particular.net/samples/sql-persistence/simple/index.md): Using SQL Persistence to store sagas and timeouts. - [Transitioning Saga Correlation IDs](https://docs.particular.net/samples/sql-persistence/transitioning-correlation-ids/index.md): An approach for transitioning between different correlation IDs with no downtime. ## SQL Server Transport - [SQL Server Transport Samples](https://docs.particular.net/samples/sqltransport/index.md) - [SQL Server transport native integration sample](https://docs.particular.net/samples/sqltransport/native-integration/index.md): Integrating natively with the SQL Server transport. - [Simple SQL Server transport usage](https://docs.particular.net/samples/sqltransport/simple/index.md): A simple send and receive scenario with the SQL Server transport. ## Transactional Session - [Transactional Session Samples](https://docs.particular.net/samples/transactional-session/index.md) - [Using TransactionalSession with Entity Framework and ASP.NET Core](https://docs.particular.net/samples/transactional-session/aspnetcore-webapi/index.md): Transactional Session sample that illustrates how to send messages and modify data with Entity Framework in an atomic manner using ASP.NET Core. - [Using Transactional Session with CosmosDB](https://docs.particular.net/samples/transactional-session/cosmosdb/index.md): Transactional Session sample that illustrates how to send messages and modify data with CosmosDB in an atomic manner outside message handlers. ## Web - [Web Samples](https://docs.particular.net/samples/web/index.md) - [Using NServiceBus in an ASP.NET Core Web Application](https://docs.particular.net/samples/web/asp-web-application/index.md) ## azure - [Using NServiceBus with Azure Table](https://docs.particular.net/samples/azure/azure-table/index.md) ## hosting - [Hosting endpoints in Aspire](https://docs.particular.net/samples/hosting/aspire/index.md) ## showcase - [Loan Broker Showcases](https://docs.particular.net/samples/showcase/loan-broker-showcase/index.md): Showcases demonstrating how to build distributed systems on AWS and Azure with NServiceBus. ## Version-specific pages - [AsyncAPI with custom message conventions (core_9)](https://docs.particular.net/samples/asyncapi/custom-message-types/index_core_9.md): How to generate an AsyncAPI schema document from NServiceBus with custom message conventions. - [Simple AsyncAPI (core_9)](https://docs.particular.net/samples/asyncapi/simple/index_core_9.md): How to generate an AsyncAPI schema document from NServiceBus. - [Simple DynamoDB Persistence Usage (dynamodb_2)](https://docs.particular.net/samples/aws/dynamodb-simple/index_dynamodb_2.md): Using DynamoDB Persistence to store sagas. - [Simple DynamoDB Persistence Usage (dynamodb_3)](https://docs.particular.net/samples/aws/dynamodb-simple/index_dynamodb_3.md): Using DynamoDB Persistence to store sagas. - [DynamoDB Persistence Usage with transactions (dynamodb_2)](https://docs.particular.net/samples/aws/dynamodb-transactions/index_dynamodb_2.md): Using DynamoDB persistence to store sagas and outbox records atomically. - [DynamoDB Persistence Usage with transactions (dynamodb_3)](https://docs.particular.net/samples/aws/dynamodb-transactions/index_dynamodb_3.md): Using DynamoDB persistence to store sagas and outbox records atomically. - [Using NServiceBus in AWS Lambda with SQS (sqslambda_2)](https://docs.particular.net/samples/aws/lambda-sqs/index_sqslambda_2.md) - [Using NServiceBus in AWS Lambda with SQS (sqslambda_3)](https://docs.particular.net/samples/aws/lambda-sqs/index_sqslambda_3.md) - [Using NServiceBus in AWS Lambda with annotations and SQS (sqslambda_2)](https://docs.particular.net/samples/aws/lambda-sqs-annotations/index_sqslambda_2.md) - [Using NServiceBus in AWS Lambda with annotations and SQS (sqslambda_3)](https://docs.particular.net/samples/aws/lambda-sqs-annotations/index_sqslambda_3.md) - [Using NServiceBus Sagas with AWS Lambda, SQS, and Aurora (sqslambda_2)](https://docs.particular.net/samples/aws/sagas-lambda-aurora/index_sqslambda_2.md): A sample demonstrating the AWS Aurora persistence, AWS Lambda, and AWS SQS with NServiceBus sagas. - [AmazonSQS transport native integration sample (sqs_7)](https://docs.particular.net/samples/aws/sqs-native-integration/index_sqs_7.md) - [AmazonSQS transport native integration sample (sqs_8)](https://docs.particular.net/samples/aws/sqs-native-integration/index_sqs_8.md) - [Simple AmazonSQS Transport usage (sqs_7)](https://docs.particular.net/samples/aws/sqs-simple/index_sqs_7.md) - [Simple AmazonSQS Transport usage (sqs_8)](https://docs.particular.net/samples/aws/sqs-simple/index_sqs_8.md) - [Using NServiceBus and Kafka in Azure Functions (isolated) (asbs_4)](https://docs.particular.net/samples/azure-functions/service-bus-kafka/index_asbs_4.md): Using NServiceBus with Kafka triggers and Azure Functions isolated worker hosting model. - [Using NServiceBus and Kafka in Azure Functions (isolated) (asbs_5)](https://docs.particular.net/samples/azure-functions/service-bus-kafka/index_asbs_5.md): Using NServiceBus with Kafka triggers and Azure Functions isolated worker hosting model. - [Using NServiceBus in Azure Functions (isolated worker) (asbfunctionsworker_5)](https://docs.particular.net/samples/azure-functions/service-bus-worker/index_asbfunctionsworker_5.md): Using NServiceBus with Azure Service Bus triggers and Azure Functions isolated worker hosting model. - [Using NServiceBus in Azure Functions (isolated worker) (asbfunctionsworker_6)](https://docs.particular.net/samples/azure-functions/service-bus-worker/index_asbfunctionsworker_6.md): Using NServiceBus with Azure Service Bus triggers and Azure Functions isolated worker hosting model. - [Azure Service Bus KeyVault Sample (asbs_4)](https://docs.particular.net/samples/azure-service-bus-netstandard/key-vault/index_asbs_4.md): Demonstrates how to use KeyVault to store connection string to the Azure Service Bus. - [Azure Service Bus KeyVault Sample (asbs_5)](https://docs.particular.net/samples/azure-service-bus-netstandard/key-vault/index_asbs_5.md): Demonstrates how to use KeyVault to store connection string to the Azure Service Bus. - [Azure Service Bus transport native integration sample (asbs_4)](https://docs.particular.net/samples/azure-service-bus-netstandard/native-integration/index_asbs_4.md): How to consume messages published by non-NServiceBus endpoints. - [Azure Service Bus transport native integration sample (asbs_5)](https://docs.particular.net/samples/azure-service-bus-netstandard/native-integration/index_asbs_5.md): How to consume messages published by non-NServiceBus endpoints. - [Azure Service Bus Pub/Sub Native Integration (asbs_4)](https://docs.particular.net/samples/azure-service-bus-netstandard/native-integration-pub-sub/index_asbs_4.md): How to consume event messages published by non-NServiceBus endpoints. - [Azure Service Bus Pub/Sub Native Integration (asbs_5)](https://docs.particular.net/samples/azure-service-bus-netstandard/native-integration-pub-sub/index_asbs_5.md): How to consume event messages published by non-NServiceBus endpoints. - [Azure Service Bus Topology Options (asbs_5)](https://docs.particular.net/samples/azure-service-bus-netstandard/options/index_asbs_5.md): How to use topology options to layout the topic topology in app settings. - [Build message-driven business applications with NServiceBus (asbs_4)](https://docs.particular.net/samples/azure-service-bus-netstandard/send-receive-with-nservicebus/index_asbs_4.md): Build message-driven business applications with NServiceBus and Azure Service Bus. - [Build message-driven business applications with NServiceBus (asbs_5)](https://docs.particular.net/samples/azure-service-bus-netstandard/send-receive-with-nservicebus/index_asbs_5.md): Build message-driven business applications with NServiceBus and Azure Service Bus. - [Azure Service Bus Send/Reply Sample (asbs_4)](https://docs.particular.net/samples/azure-service-bus-netstandard/send-reply/index_asbs_4.md): Demonstrates the send/reply pattern with Azure Service Bus. - [Azure Service Bus Send/Reply Sample (asbs_5)](https://docs.particular.net/samples/azure-service-bus-netstandard/send-reply/index_asbs_5.md): Demonstrates the send/reply pattern with Azure Service Bus. - [Azure Service Bus topology migration (asbs_5)](https://docs.particular.net/samples/azure-service-bus-netstandard/topology-migration/index_asbs_5.md): Demonstrates how to migrate from the single-topic to topic-per-event topology. - [Azure Table Persistence Using Saga IDs as Partition Keys (astp_4)](https://docs.particular.net/samples/azure/azure-table/saga-transactions/index_astp_4.md): Using Saga IDs as partition keys in Azure Table Persistence to store sagas and outbox records atomically. - [Azure Table Persistence Using Saga IDs as Partition Keys (astp_5)](https://docs.particular.net/samples/azure/azure-table/saga-transactions/index_astp_5.md): Using Saga IDs as partition keys in Azure Table Persistence to store sagas and outbox records atomically. - [Azure Table Persistence Using Saga IDs as Partition Keys (astp_6)](https://docs.particular.net/samples/azure/azure-table/saga-transactions/index_astp_6.md): Using Saga IDs as partition keys in Azure Table Persistence to store sagas and outbox records atomically. - [Simple Azure Table Persistence Usage (astp_4)](https://docs.particular.net/samples/azure/azure-table/simple/index_astp_4.md): Using Azure Table Persistence to store sagas. - [Simple Azure Table Persistence Usage (astp_5)](https://docs.particular.net/samples/azure/azure-table/simple/index_astp_5.md): Using Azure Table Persistence to store sagas. - [Simple Azure Table Persistence Usage (astp_6)](https://docs.particular.net/samples/azure/azure-table/simple/index_astp_6.md): Using Azure Table Persistence to store sagas. - [AzureTable Persistence Usage with non-default table (astp_4)](https://docs.particular.net/samples/azure/azure-table/table/index_astp_4.md): Using Azure Table Persistence to store sagas providing a non-default table dynamically. - [AzureTable Persistence Usage with non-default table (astp_5)](https://docs.particular.net/samples/azure/azure-table/table/index_astp_5.md): Using Azure Table Persistence to store sagas providing a non-default table dynamically. - [AzureTable Persistence Usage with non-default table (astp_6)](https://docs.particular.net/samples/azure/azure-table/table/index_astp_6.md): Using Azure Table Persistence to store sagas providing a non-default table dynamically. - [Azure Table Persistence Usage with Transactions (astp_4)](https://docs.particular.net/samples/azure/azure-table/transactions/index_astp_4.md): Using Azure Table Persistence to store sagas and outbox records atomically. - [Azure Table Persistence Usage with Transactions (astp_5)](https://docs.particular.net/samples/azure/azure-table/transactions/index_astp_5.md): Using Azure Table Persistence to store sagas and outbox records atomically. - [Azure Table Persistence Usage with Transactions (astp_6)](https://docs.particular.net/samples/azure/azure-table/transactions/index_astp_6.md): Using Azure Table Persistence to store sagas and outbox records atomically. - [Custom audit transport (core_9)](https://docs.particular.net/samples/azure/custom-audit-transport/index_core_9.md): Azure Service Bus endpoint with audit via Azure Storage Queue. - [Azure Storage Queues transport native integration sample (asqn_11)](https://docs.particular.net/samples/azure/native-integration-asq/index_asqn_11.md): Consuming messages sent by non-NServiceBus endpoints with the Azure Storage Queues transport. - [Azure Storage Queues transport native integration sample (asqn_12)](https://docs.particular.net/samples/azure/native-integration-asq/index_asqn_12.md): Consuming messages sent by non-NServiceBus endpoints with the Azure Storage Queues transport. - [Azure Storage Queues transport native integration sample (asqn_13)](https://docs.particular.net/samples/azure/native-integration-asq/index_asqn_13.md): Consuming messages sent by non-NServiceBus endpoints with the Azure Storage Queues transport. - [Azure Storage Queues Transport (asqn_11)](https://docs.particular.net/samples/azure/storage-queues/index_asqn_11.md) - [Azure Storage Queues Transport (asqn_12)](https://docs.particular.net/samples/azure/storage-queues/index_asqn_12.md) - [Azure Storage Queues Transport (asqn_13)](https://docs.particular.net/samples/azure/storage-queues/index_asqn_13.md) - [Self-Hosting in Azure WebJobs (core_9)](https://docs.particular.net/samples/azure/webjob-host/index_core_9.md): Host an NServiceBus endpoint in Azure WebJobs. - [Bridge messages between endpoints using MSMQ and Azure Service Bus (bridge_3)](https://docs.particular.net/samples/bridge/azure-service-bus-msmq-bridge/index_bridge_3.md): A sample showing how to send messages between endpoints using different transports using NServiceBus Messaging Bridge. - [Bridge messages between endpoints using MSMQ and Azure Service Bus (bridge_4)](https://docs.particular.net/samples/bridge/azure-service-bus-msmq-bridge/index_bridge_4.md): A sample showing how to send messages between endpoints using different transports using NServiceBus Messaging Bridge. - [Bridge messages between endpoints using MSMQ and Azure Service Bus (transportbridge_1)](https://docs.particular.net/samples/bridge/azure-service-bus-msmq-bridge/index_transportbridge_1.md): A sample showing how to send messages between endpoints using different transports using NServiceBus Messaging Bridge. - [Use Bridge to connect to ServiceControl running on different transport (bridge_3)](https://docs.particular.net/samples/bridge/service-control/index_bridge_3.md): Centralize monitoring of mixed transport solution with the Bridge. - [Use Bridge to connect to ServiceControl running on different transport (bridge_4)](https://docs.particular.net/samples/bridge/service-control/index_bridge_4.md): Centralize monitoring of mixed transport solution with the Bridge. - [Use Bridge to connect to ServiceControl running on different transport (transportbridge_1)](https://docs.particular.net/samples/bridge/service-control/index_transportbridge_1.md): Centralize monitoring of mixed transport solution with the Bridge. - [Simple Bridge Usage (bridge_3)](https://docs.particular.net/samples/bridge/simple/index_bridge_3.md): How to use the NServiceBus messaging bridge to connect endpoints on different transports. - [Simple Bridge Usage (bridge_4)](https://docs.particular.net/samples/bridge/simple/index_bridge_4.md): How to use the NServiceBus messaging bridge to connect endpoints on different transports. - [Simple Bridge Usage (transportbridge_1)](https://docs.particular.net/samples/bridge/simple/index_transportbridge_1.md): How to use the NServiceBus messaging bridge to connect endpoints on different transports. - [Multi-Instance Mode (bridge_3)](https://docs.particular.net/samples/bridge/sql-multi-instance/index_bridge_3.md): SQL Server transport running in multi-instance mode using Bridge. - [Multi-Instance Mode (bridge_4)](https://docs.particular.net/samples/bridge/sql-multi-instance/index_bridge_4.md): SQL Server transport running in multi-instance mode using Bridge. - [Multi-Instance Mode (transportbridge_1)](https://docs.particular.net/samples/bridge/sql-multi-instance/index_transportbridge_1.md): SQL Server transport running in multi-instance mode using Bridge. - [Callback Usage (callbacks_5)](https://docs.particular.net/samples/callbacks/index_callbacks_5.md): Demonstrates the use of callbacks. - [Consumer-driven Contracts sample (core_9)](https://docs.particular.net/samples/consumer-driven-contracts/index_core_9.md): NServiceBus sample that shows a consumer-driven contract (CDC) approach to messaging. (supported: [6.0.0, )) - [Cooperative cancellation (core_9)](https://docs.particular.net/samples/cooperative-cancellation/index_core_9.md): Stopping both the endpoint and a long running handler with a cancellation token. - [Cosmos DB Persistence Usage with non-default container (cosmosdb_3)](https://docs.particular.net/samples/cosmosdb/container/index_cosmosdb_3.md): Using Cosmos DB Persistence to store sagas providing a non-default container dynamically. - [Cosmos DB Persistence Usage with Encryption (cosmosdb_3)](https://docs.particular.net/samples/cosmosdb/encryption/index_cosmosdb_3.md): Using Cosmos DB Persistence to store sagas with encryption. - [Simple Cosmos DB Persistence Usage (cosmosdb_3)](https://docs.particular.net/samples/cosmosdb/simple/index_cosmosdb_3.md): Using Cosmos DB Persistence to store sagas. - [Cosmos DB Persistence Usage with transactions (cosmosdb_3)](https://docs.particular.net/samples/cosmosdb/transactions/index_cosmosdb_3.md): Using Cosmos DB Persistence to store sagas and outbox records atomically. - [Custom Recoverability (core_9)](https://docs.particular.net/samples/custom-recoverability/index_core_9.md): Custom Recoverability Messaging Policy approaches to help with failure scenarios. - [Azure Blob Storage DataBus (absdatabus_6)](https://docs.particular.net/samples/databus/blob-storage-databus/index_absdatabus_6.md): Sending large attachments with NServiceBus over Azure blob storage. - [Azure Blob Storage Data Bus Cleanup with Azure Functions (absdatabus_6)](https://docs.particular.net/samples/databus/blob-storage-databus-cleanup-function/index_absdatabus_6.md): Using an Azure Function instead of the built in blob cleanup capabilities. - [Custom Serializer for Data Bus (databus_1)](https://docs.particular.net/samples/databus/custom-serializer/index_databus_1.md): Send a message that includes a DataBus property serialized using a custom serializer. - [Databus with SystemJsonSerializer message serializer (core_9)](https://docs.particular.net/samples/databus/databus-custom-serializer-converter/index_core_9.md): The file share data bus allows large properties to be transferred via a Windows file share using custom converter for SystemJsonSerializer. - [Databus with SystemJsonSerializer message serializer (databus_1)](https://docs.particular.net/samples/databus/databus-custom-serializer-converter/index_databus_1.md): The file share data bus allows large properties to be transferred via a Windows file share using custom converter for SystemJsonSerializer. - [File Share Data Bus Usage (databus_1)](https://docs.particular.net/samples/databus/file-share-databus/index_databus_1.md): The file share data bus allows large properties to be transferred via a Windows file share. - [Redis claim check (core_9)](https://docs.particular.net/samples/databus/redis/index_core_9.md): Implementing the claim check pattern with Redis. - [Delayed Delivery (core_9)](https://docs.particular.net/samples/delayed-delivery/index_core_9.md): A simple ordering system that defers handling or delivery of a message. - [ASP.NET Core Dependency Injection Integration (core_9)](https://docs.particular.net/samples/dependency-injection/aspnetcore/index_core_9.md) - [Message property encryption (propertyencryption_5)](https://docs.particular.net/samples/encryption/basic-encryption/index_propertyencryption_5.md): Encrypting specific parts of a message using the message property encryption feature. - [Unobtrusive property encryption (propertyencryption_5)](https://docs.particular.net/samples/encryption/encryption-conventions/index_propertyencryption_5.md): Encrypting specific parts of a message using conventions. - [Message body encryption (core_9)](https://docs.particular.net/samples/encryption/message-body-encryption/index_core_9.md): Encrypting the full message body using a mutator. - [Entity Framework Core integration with SQL Persistence (sqlpersistence_8)](https://docs.particular.net/samples/entity-framework-core/index_sqlpersistence_8.md): Integrating Entity Framework Core with SQL Persistence. - [Automatic Retries (core_9)](https://docs.particular.net/samples/errorhandling/index_core_9.md): Shows immediate and delayed retries when a handler throws an exception. - [Fault Tolerance (core_9)](https://docs.particular.net/samples/faulttolerance/index_core_9.md): Messaging approaches to help with failure scenarios. - [Building a custom feature (core_9)](https://docs.particular.net/samples/feature/index_core_9.md): How to build a custom feature in NServiceBus. - [Full Duplex (core_9)](https://docs.particular.net/samples/fullduplex/index_core_9.md): Using full-duplex and request/response communication. - [Gateway (gateway_5)](https://docs.particular.net/samples/gateway/index_gateway_5.md) - [Header Manipulation (core_9)](https://docs.particular.net/samples/header-manipulation/index_core_9.md): All extension points for mutating messages. - [Hosting endpoints in Docker Linux containers (core_9)](https://docs.particular.net/samples/hosting/docker/index_core_9.md): Hosting multiple endpoints in several Docker Linux containers managed by Docker Compose. - [Endpoint hosting with the Generic Host (core_9)](https://docs.particular.net/samples/hosting/generic-host/index_core_9.md): Hosting an endpoint with the Microsoft Generic Host. - [Immutable Messages samples (core_9)](https://docs.particular.net/samples/immutable-messages/index_core_9.md): Demonstrate how to use immutable messages when exchanging messages between endpoints. - [Capture and visualize metrics using Datadog (core_9)](https://docs.particular.net/samples/logging/datadog/index_core_9.md): Illustrates how to capture, store, and visualize NServiceBus metrics in Datadog. - [NServiceBus.Extensions.Logging Usage (extensions.logging_3)](https://docs.particular.net/samples/logging/extensions-logging/index_extensions.logging_3.md): A sample that uses Microsoft.Extensions.Logging with NLog. - [Write metrics to the trace log (metrics_5)](https://docs.particular.net/samples/logging/metrics/index_metrics_5.md): How to write metrics information to the trace log. - [Capture and visualize metrics using NewRelic (metrics_5)](https://docs.particular.net/samples/logging/new-relic/index_metrics_5.md): Illustrates how to capture, store, and visualize NServiceBus metrics in NewRelic. - [Notifications (core_9)](https://docs.particular.net/samples/logging/notifications/index_core_9.md) - [Message Mutators (core_9)](https://docs.particular.net/samples/messagemutators/index_core_9.md): Change messages by plugging custom logic in to a couple of interfaces, encrypting as required. - [MongoDB Persistence (mongodb_4)](https://docs.particular.net/samples/mongodb/simple/index_mongodb_4.md): Learn how to use MongoDB as a persistence mechanism for NServiceBus, including saga and timeout storage. - [MongoDB Persistence (mongodb_5)](https://docs.particular.net/samples/mongodb/simple/index_mongodb_5.md): Learn how to use MongoDB as a persistence mechanism for NServiceBus, including saga and timeout storage. - [MongoDB Persistence (mongodb_6)](https://docs.particular.net/samples/mongodb/simple/index_mongodb_6.md): Learn how to use MongoDB as a persistence mechanism for NServiceBus, including saga and timeout storage. - [Injecting tenant-aware components into message handlers (core_9)](https://docs.particular.net/samples/multi-tenant/di/index_core_9.md): How to configure IoC to inject tenant-aware components into message handlers. - [NHibernate persistence in multi-tenant systems (nhibernate_10)](https://docs.particular.net/samples/multi-tenant/nhibernate/index_nhibernate_10.md): Configure NHibernate persistence to support multi-tenant scenarios. - [Propagating Tenant Information to Downstream Endpoints (core_9)](https://docs.particular.net/samples/multi-tenant/propagation/index_core_9.md): How to configure the pipeline to propagate tenant information to downstream endpoints automatically. - [RavenDB Persistence in multi-tenant systems (raven_10)](https://docs.particular.net/samples/multi-tenant/ravendb/index_raven_10.md): Configure RavenDB Persistence to support multi-tenant scenarios. - [RavenDB Persistence in multi-tenant systems (raven_9)](https://docs.particular.net/samples/multi-tenant/ravendb/index_raven_9.md): Configure RavenDB Persistence to support multi-tenant scenarios. - [SQL Persistence in multi-tenant system (sqlpersistence_8)](https://docs.particular.net/samples/multi-tenant/sqlp/index_sqlpersistence_8.md): Configure SQL Persistence to support multi-tenant scenarios. - [Near Real-Time Occasionally-Connected Clients (core_9)](https://docs.particular.net/samples/near-realtime-clients/index_core_9.md): How to relay NServiceBus events to occasionally-connected clients via SignalR. - [NServiceBus.NHibernate custom saga mapping sample (nhibernate_10)](https://docs.particular.net/samples/nhibernate/custom-mappings/index_nhibernate_10.md): An NServiceBus sample demonstrating a custom saga mapping to change how NHibernate creates the database schema using different techniques. - [Simple NHibernate Persistence Usage (nhibernate_10)](https://docs.particular.net/samples/nhibernate/simple/index_nhibernate_10.md): Using NHibernate to store saga data and business data. - [Monitoring NServiceBus endpoints with Application Insights (core_9)](https://docs.particular.net/samples/open-telemetry/application-insights/index_core_9.md): How to configure NServiceBus to export OpenTelemetry traces and meters to Application Insights. - [Customizing OpenTelemetry tracing (core_9)](https://docs.particular.net/samples/open-telemetry/customizing/index_core_9.md): Demonstrates how to add data to existing OpenTelemetry traces. - [Monitoring NServiceBus endpoints with Jaeger (core_9)](https://docs.particular.net/samples/open-telemetry/jaeger/index_core_9.md): How to configure NServiceBus to export OpenTelemetry traces to Jaeger. - [Connecting OpenTelemetry traces and logs (core_9)](https://docs.particular.net/samples/open-telemetry/logging/index_core_9.md): How to connect OpenTelemetry traces to logs in an NServiceBus endpoint. - [Capturing message properties as OpenTelemetry span tags (core_9)](https://docs.particular.net/samples/open-telemetry/message-tags/index_core_9.md): Demonstrates how to use pipeline behaviors to capture specific values from message body properties and headers as tags on OpenTelemetry spans. - [Use a shim to expose NServiceBus.Metrics via OpenTelemetry (core_9)](https://docs.particular.net/samples/open-telemetry/metrics-shim/index_core_9.md): How to set up a shim to expose NServiceBus.Metrics via OpenTelemetry. - [Monitoring NServiceBus endpoints with Prometheus and Grafana (core_9)](https://docs.particular.net/samples/open-telemetry/prometheus-grafana/index_core_9.md): How to configure NServiceBus to export OpenTelemetry metrics to Prometheus and Grafana. - [Using Outbox with CosmosDB (core_9)](https://docs.particular.net/samples/outbox/cosmosdb/index_core_9.md): Demonstrates how the Outbox handles duplicate messages using RabbitMQ and CosmosDb hosted in Docker containers. - [Using Outbox with MongoDB (core_9)](https://docs.particular.net/samples/outbox/mongodb/index_core_9.md): Demonstrates how the Outbox handles duplicate messages using RabbitMQ and MongoDB hosted in Docker containers. - [Using Outbox with RabbitMQ (core_9)](https://docs.particular.net/samples/outbox/rabbit/index_core_9.md): Demonstrates how the Outbox handles duplicate messages using RabbitMQ and SQL Server hosted in Docker containers. - [Using Outbox with SQL Server (core_9)](https://docs.particular.net/samples/outbox/sql/index_core_9.md): A sample demonstrating the SQL Server transport with SQL Persistence and ADO.NET user data store using outbox. - [Performance Counter Usage (perfcounters_6)](https://docs.particular.net/samples/performance-counters/index_perfcounters_6.md): Using the built-in Performance Counters. - [Audit Filter Pipeline Extension (core_9)](https://docs.particular.net/samples/pipeline/audit-filtering/index_core_9.md): Extending the pipeline to stop certain messages from being audited. - [Dispatch notification pipeline extension (core_9)](https://docs.particular.net/samples/pipeline/dispatch-notifications/index_core_9.md): Extending the pipeline to fire a notification when messages are dispatched. - [Add feature toggles to handlers (core_9)](https://docs.particular.net/samples/pipeline/feature-toggle/index_core_9.md): Checks feature toggles to determine whether or not a handler should be executed for a given message. - [Repair malformed messages using pipeline behavior (core_9)](https://docs.particular.net/samples/pipeline/fix-messages-using-behavior/index_core_9.md): A sample showing how to repair malformed messages by implementing a pipeline behavior. - [Header propagation using the pipeline (core_9)](https://docs.particular.net/samples/pipeline/header-propagation/index_core_9.md): How to use the pipeline to copy a header from incoming messages to outgoing messages. - [Consuming MassTransit messages with NServiceBus (core_9)](https://docs.particular.net/samples/pipeline/masstransit-messages/index_core_9.md): Use the NServiceBus pipeline to consume messages sent by MassTransit. - [Message signing using NServiceBus pipeline behaviors (core_9)](https://docs.particular.net/samples/pipeline/message-signing/index_core_9.md): Shows how to implement message signing and verification using NServiceBus pipeline behaviors. - [Session filter pipeline extension (core_9)](https://docs.particular.net/samples/pipeline/session-filtering/index_core_9.md): How to extend the pipeline to filter out messages from older sessions. - [Unit of work using custom pipeline behavior (core_9)](https://docs.particular.net/samples/pipeline/unit-of-work/index_core_9.md): How to use IoC and a pipeline behavior to create a custom unit of work implementation. - [Connect to ServicePlatform with code-first configuration (platformconnector_3)](https://docs.particular.net/samples/platform-connector/code-first/index_platformconnector_3.md): A sample that shows how to connect an NServiceBus endpoint to the Particular Service Platform using the code-first API. - [Connect to ServicePlatform with JSON configuration (platformconnector_3)](https://docs.particular.net/samples/platform-connector/json/index_platformconnector_3.md): A sample that shows how to connect an NServiceBus endpoint to the Particular Service Platform using the JSON schema. - [Connect to ServicePlatform using the .NET Generic Host (platformconnector_3)](https://docs.particular.net/samples/platform-connector/ms-config/index_platformconnector_3.md): A sample that shows how to connect an NServiceBus endpoint hosted in the .NET Generic Host to the Particular Service Platform. - [Simple PostgreSQL transport usage (postgresqltransport_8)](https://docs.particular.net/samples/postgresqltransport/simple/index_postgresqltransport_8.md): Learn how to configure NServiceBus with the PostgreSQL transport to send commands and publish events between endpoints using native publish-subscribe. - [Native Publish/Subscribe (core_9)](https://docs.particular.net/samples/pubsub/native/index_core_9.md): Publish/Subscribe with multicast-enabled transports. - [RabbitMQ transport native integration sample (rabbit_10)](https://docs.particular.net/samples/rabbitmq/native-integration/index_rabbit_10.md): Consuming messages published by non-NServiceBus endpoints. - [RabbitMQ transport native integration sample (rabbit_9)](https://docs.particular.net/samples/rabbitmq/native-integration/index_rabbit_9.md): Consuming messages published by non-NServiceBus endpoints. - [Simple RabbitMQ Transport Usage (rabbit_10)](https://docs.particular.net/samples/rabbitmq/simple/index_rabbit_10.md) - [Simple RabbitMQ Transport Usage (rabbit_9)](https://docs.particular.net/samples/rabbitmq/simple/index_rabbit_9.md) - [Simple RavenDB Persistence Usage (raven_10)](https://docs.particular.net/samples/ravendb/simple/index_raven_10.md): Using RavenDB to store Sagas. - [Simple RavenDB Persistence Usage (raven_9)](https://docs.particular.net/samples/ravendb/simple/index_raven_9.md): Using RavenDB to store Sagas. - [Unit Testing a custom recoverability policy (core_9)](https://docs.particular.net/samples/recoverabilitypolicytesting/index_core_9.md): Writing unit tests for custom recoverability policies. - [Command routing (core_9)](https://docs.particular.net/samples/routing/command-routing/index_core_9.md): Basic NServiceBus message routing. - [Message forwarding (core_9)](https://docs.particular.net/samples/routing/message-forwarding/index_core_9.md): Forwarding a copy of every message to another destination after it is processed. - [Batch messages using sagas (core_9)](https://docs.particular.net/samples/saga/batching/index_core_9.md): Use batching when generating tasks using sagas. - [NHibernate Custom Saga Finding Logic (nhibernate_10)](https://docs.particular.net/samples/saga/nh-custom-sagafinder/index_nhibernate_10.md): Implement custom saga-finding behavior using custom query logic when saga data is stored in a relational database and accessed via the NHibernate ORM. - [Simple Saga Usage (core_9)](https://docs.particular.net/samples/saga/simple/index_core_9.md): How build and use a saga. - [SQL Persistence Saga Finding Logic (sqlpersistence_8)](https://docs.particular.net/samples/saga/sql-sagafinder/index_sqlpersistence_8.md): Perform custom saga finding logic based on custom queries when the Saga storage is the native SQL Persistence. - [Hangfire Usage (core_9)](https://docs.particular.net/samples/scheduling/hangfire/index_core_9.md): Using Hangfire to send messages from within an NServiceBus endpoint. - [PeriodTimer usage (core_9)](https://docs.particular.net/samples/scheduling/periodictimer/index_core_9.md): Using PeriodicTimer in a BackgroundJob to send messages from within an NServiceBus endpoint. - [Quartz.NET Usage (core_9)](https://docs.particular.net/samples/scheduling/quartz/index_core_9.md): Using Quartz.NET to send messages from within an NServiceBus endpoint. - [Scheduling with Timers (core_9)](https://docs.particular.net/samples/scheduling/timer/index_core_9.md): An example of scheduling using .NET Timers. - [Avro Serializer sample (core_9)](https://docs.particular.net/samples/serializers/avro/index_core_9.md): NServiceBus sample that shows how to use the Avro serializer in an endpoint. - [Multiple Deserializers (core_9)](https://docs.particular.net/samples/serializers/multiple-deserializers/index_core_9.md): Using the AddDeserializer API to enable deserializing multiple formats. - [Newtonsoft JSON Serializer sample (newtonsoft_4)](https://docs.particular.net/samples/serializers/newtonsoft/index_newtonsoft_4.md): NServiceBus sample that shows how to use the Newtonsoft JSON serializer in an endpoint. - [Newtonsoft BSON Serializer (newtonsoft_4)](https://docs.particular.net/samples/serializers/newtonsoft-bson/index_newtonsoft_4.md): Using the Newtonsoft BSON serializer in an endpoint. - [System.Text.Json Serializer sample (core_9)](https://docs.particular.net/samples/serializers/system-json/index_core_9.md): NServiceBus sample that shows how to use the builtin System.Text.Json serializer in an endpoint. - [Transition serialization formats (core_9)](https://docs.particular.net/samples/serializers/transitioning-formats/index_core_9.md): An approach for introducing a breaking change to message serialization with no downtime. - [XML Serializer sample (core_9)](https://docs.particular.net/samples/serializers/xml/index_core_9.md): NServiceBus sample that shows how to use the default NServiceBus XML serializer. - [Monitor ServiceControl events with Azure Application Insights (servicecontrolcontracts_4)](https://docs.particular.net/samples/servicecontrol/azure-monitor-events/index_servicecontrolcontracts_4.md): A sample showing how to monitor events published by ServiceControl with Azure Application Insights. - [Monitor with ServiceControl events (servicecontrolcontracts_4)](https://docs.particular.net/samples/servicecontrol/events-subscription/index_servicecontrolcontracts_4.md): A sample showing how to monitor events in ServiceControl. - [Repair malformed messages using ServiceControl retry redirects (core_9)](https://docs.particular.net/samples/servicecontrol/fix-messages/index_core_9.md): A sample showing how to repair malformed messages by redirecting them to a temporary endpoint. - [Monitor third-party systems with custom checks (customchecks_5)](https://docs.particular.net/samples/servicecontrol/monitoring3rdparty/index_customchecks_5.md): Monitoring third-party systems which are exposed as HTTP endpoints with custom checks. - [Retry failed messages using ServicePulse (core_9)](https://docs.particular.net/samples/servicecontrol/retry-messages/index_core_9.md): A sample showing how to retry failed messages. - [Cinema Showcase (core_9)](https://docs.particular.net/samples/showcase/cinema/index_core_9.md): A sample for a fictional cinema demonstrating a saga that aggregates ticket sales. - [On-Premises Showcase (core_9)](https://docs.particular.net/samples/showcase/on-premises/index_core_9.md): Implements a fictional store using several features of NServiceBus. - [Injecting repository pattern services (sqlpersistence_8)](https://docs.particular.net/samples/sql-persistence/injecting-services/index_sqlpersistence_8.md): Inject services into an endpoint that share the same DbConnection used by NServiceBus. - [SQL Persistence Saga Rename (sqlpersistence_8)](https://docs.particular.net/samples/sql-persistence/saga-rename/index_sqlpersistence_8.md): Renaming a saga that is stored in the SQL Persistence. - [Simple SQL Persistence Usage (sqlpersistence_8)](https://docs.particular.net/samples/sql-persistence/simple/index_sqlpersistence_8.md): Using SQL Persistence to store sagas and timeouts. - [Transitioning Saga Correlation IDs (sqlpersistence_8)](https://docs.particular.net/samples/sql-persistence/transitioning-correlation-ids/index_sqlpersistence_8.md): An approach for transitioning between different correlation IDs with no downtime. - [SQL Server Transport and NHibernate Persistence (core_9)](https://docs.particular.net/samples/sqltransport-nhpersistence/index_core_9.md): Integrating SQL Server transport with NHibernate persistence. - [SQL Server Transport and SQL Persistence (core_9)](https://docs.particular.net/samples/sqltransport-sqlpersistence/index_core_9.md): Integrating the SQL Server transport with SQL persistence. - [SQL Server transport native integration sample (sqltransport_8)](https://docs.particular.net/samples/sqltransport/native-integration/index_sqltransport_8.md): Integrating natively with the SQL Server transport. - [Simple SQL Server transport usage (sqltransport_8)](https://docs.particular.net/samples/sqltransport/simple/index_sqltransport_8.md): A simple send and receive scenario with the SQL Server transport. - [Message Throughput Throttling (core_9)](https://docs.particular.net/samples/throttling/index_core_9.md) - [Using TransactionalSession with Entity Framework and ASP.NET Core (sqlpersistencets_7)](https://docs.particular.net/samples/transactional-session/aspnetcore-webapi/index_sqlpersistencets_7.md): Transactional Session sample that illustrates how to send messages and modify data with Entity Framework in an atomic manner using ASP.NET Core. - [Using TransactionalSession with Entity Framework and ASP.NET Core (sqlpersistencets_8)](https://docs.particular.net/samples/transactional-session/aspnetcore-webapi/index_sqlpersistencets_8.md): Transactional Session sample that illustrates how to send messages and modify data with Entity Framework in an atomic manner using ASP.NET Core. - [Using Transactional Session with CosmosDB (cosmosts_2)](https://docs.particular.net/samples/transactional-session/cosmosdb/index_cosmosts_2.md): Transactional Session sample that illustrates how to send messages and modify data with CosmosDB in an atomic manner outside message handlers. - [Using Transactional Session with CosmosDB (cosmosts_3)](https://docs.particular.net/samples/transactional-session/cosmosdb/index_cosmosts_3.md): Transactional Session sample that illustrates how to send messages and modify data with CosmosDB in an atomic manner outside message handlers. - [Unit Testing NServiceBus (testing_9)](https://docs.particular.net/samples/unit-testing/index_testing_9.md): Writing unit tests for NServiceBus systems. - [Unobtrusive (core_9)](https://docs.particular.net/samples/unobtrusive/index_core_9.md): Demonstrates NServiceBus operating in unobtrusive mode. - [Versioning (core_9)](https://docs.particular.net/samples/versioning/index_core_9.md): Message evolution over time using interfaces. - [Using NServiceBus in an ASP.NET Core Web Application (core_9)](https://docs.particular.net/samples/web/asp-web-application/index_core_9.md)