NServiceBus

NServiceBus, the heart of the system, is a messaging and workflow framework that helps create distributed systems that are scalable, reliable and easy to modify. It supports various messaging patterns, handles long-running business processes in the form of sagas and provides abstraction over multiple queuing technologies. While most queuing technologies try to make guarantees regarding 'at least once' or even 'exactly once' delivery, they often fall short of this promise. NServiceBus contains mechanisms to automatically solve intermittent delivery problems by retrying messages and falling back to an error queue where they can be exposed by the rest of the Platform for human intervention (ServiceControl, ServicePulse).

Moreover, NServiceBus is thoroughly extensible and can be tailored for many requirements. It is compatible with several technologies and many elements of the system can be replaced with custom implementations.

Related Articles

  • Concepts Overview
    A high level feature and concept overview of NServiceBus.
  • Exposing Endpoints via WCF
    Receiving and processing messages which pass through WCF.
  • Handlers and Sagas
    Introduction to Handlers and Sagas.
  • Licensing
    Outlines license usage, management, and restrictions.
  • Outbox
    Reliable messaging without distributed transactions.
  • Satellites
    Extension point for raw processing of messages.
  • Scheduling
    Schedule a task or an action/lambda, to be executed repeatedly at a given interval.
  • Testing NServiceBus
    Develop service layers and long-running processes using test-driven development.

Bus versus broker architecture

Bus versus broker architectural styles.

  • Architectural Principles
    NServiceBus helps write code that is robust in production environments, preventing data loss under failure conditions.

NServiceBus and Azure

Using Azure for endpoint hosting and to provide Transports and Persistence.

Azure Service Bus Transport

Azure Storage Persistence

Using Azure Storage as persistence.

Azure Storage Queues Transport

Using Azure Storage Queues as transport.

Containers

NServiceBus automatically registers components, handlers, and sagas.

  • Autofac
    Configure NServiceBus to use Autofac as a container.
  • Castle Windsor
    Configure NServiceBus to use Castle Windsor as a container.
  • Child Containers
    Child containers are a snapshot of the main container; transient instances are treated as as singletons in the child container.
  • Using IBus in a Message Handler
    Use setter injection or constructor injection.
  • Ninject
    Configure NServiceBus to use Ninject as a container.
  • Property injection
  • Spring
    Configure NServiceBus to use Spring as a container.
  • StructureMap
    Configuring NServiceBus to use StructureMap as a container.
  • Unity
    Configuring NServiceBus to use Unity as a container.

Endpoints

Describe the concepts of Endpoint and Endpoint Instance.

Gateway

Durable fire-and-forget messaging across physically separated IT infrastructure.

Handlers

Write a class to handle messages in NServiceBus.

Hosting

Outlines the various approaches to hosting NServiceBus.

Interface life-cycles

The life-cycles of the various NServiceBus configuration interfaces.

Logging

Manage and integrate with NServiceBus logging.

Messaging

Outline the various approach to sending-receiving, defining messages and common messaging patterns.

MSMQ Transport

MSMQ is the primary durable communications technology for Microsoft but does not dynamically detect network interfaces.

NHibernate Persistence

NHibernate-based persistence for NServiceBus.

Operations

Operations Table of Contents.

Persistence In NServiceBus

Features of NServiceBus requiring persistence include timeouts, sagas, and subscription storage.

Message Handling Pipeline

Overview of the message handling pipeline.

RabbitMQ Transport

RavenDB Persistence

Recoverability

Avoid handling exceptions in the message handlers.

Sagas

NServiceBus uses event-driven architecture to include fault-tolerance and scalability in long-term business processes.

  • Concurrency
    NServiceBus gives ACID semantics, using underlying storage so only one worker thread hitting a saga instance can commit.
  • Message Correlation
    Correlation is needed in order to find existing saga instances based on data on the incoming message.
  • Reply and ReplyToOriginator differences
    Document the different behaviors of the Reply and ReplyToOriginator methods of the IMessageHandlerContext/IBus instance.
  • Complex saga finding logic
    Use IFindSaga to write custom code that resolves sagas.
  • Sagas Not Found
    How a message is handled when it could be executed by a saga but no saga could be found.
  • Saga Timeouts
    Call back into a saga after a defined period of time.

Scalability and HA

Scalability and High Availability options for NServiceBus.

Security

Security Table of Contents.

Serialization

How instances of .NET classes are serialized onto the transport.

SQL Server Transport

High-level description of NServiceBus SQL Server Transport.

Transports

Upgrade Guides


Last modified