Home - rebus-org/Rebus GitHub Wiki

Rebus

Welcome dear friend!

Welcome to the official Rebus documentation wiki! In here, you will find a few snippets and some words about Rebus. If you haven't already done it, you might want to read the introduction.

If you came here to find out how to bring Rebus into your project, you can simply

Install-Package Rebus -ProjectName <your-project>

in order to install Rebus into your project, possibly followed by adding one or more of the good many integration packages available from Nuget.org.

These days, since most modern things in .NET will most likely be running in Microsoft's generic host, you probably want to

Install-Package Rebus.ServiceProvider -ProjectName <your-project>

too, to be able to easily hook it up with the service provider.

After that, you can do something like this:

services.AddRebus(
    configure => configure
        .Transport(t => t.Use<2>)
        .<3>
);

to initialize it, or

Configure.With(<1>)
    .Transport(t => t.Use<2>)
    .<3>
    .Start();

if you're not using the service provider, where

  1. would be either Rebus' BuiltinHandlerActivator or a "container adapter" (i.e. a bridge to your favorite IoC container)
  2. would depend on which transport you intended to use – e.g. if you Install-Package Rebus.AzureServiceBus, an extension method would be available so you could do this: .Transport(t => t.UseAzureServiceBus(connectionString, "my-queue"))
  3. would be zero or more additional configuration extensions

and then the bus would be started.

Please check out the samples repository for several examples on what can be configured.

Getting started

Requirements

Rebus depends on Newtonsoft JSON.NET and System.Text.Json only, and it targets .NET Standard 2.0, making it consumable on .NET 4.6.2, .NET Core 2, .NET 5 and all subsequent .NET releases. This means that there is a pretty good chance that Rebus is supported on your platform, regardless of whether you are using modern .NET, or .NET Framework or .NET Core.

Integration with other stuff can be achieved with various integration DLLs, which of course might impact supported platforms (e.g. Rebus.Msmq does not support .NET/.NET Core, because there is only an MSMQ driver for .NET Framework).

Get the library

Rebus binaries are available as NuGet packages on NuGet.org and can be found by searching for NuGet packages with the text "rebus". If you're a PSH person, you could e.g. install-package rebus -projectName NameOfYourProject.

Walkthrough

You might want to take a look at this very simple sample:

Also, you might want to check out the "Scenarios" section further down for some information on how different problems can be solved very elegantly with Rebus.

Samples

If you're interested in seeing running code that show off various pieces of functionality in Rebus, you should take a look at the RebusSamples repository – it has code samples e.g. for request/reply, pub/sub, sagas, etc.

Configuration

There's basically two ways of configuring Rebus: The configuration API and manual configuration. The configuration API is the preferred way of configuring it, but it can be an educative experience to try and configure it manually as well - just to get a chance to ponder a bit over each of Rebus' dependencies.

The following aspects can be (and some of them must be) configured:

When you're considering which aspects to configure, please take a moment to study the different bus modes - that should enable you to judge which aspects are required to configure, and which aspects can safely be left out.

Here's a couple of things that you might want to read:

Scenarios

Here, I will briefly cover different scenarios where Rebus can really help.

and then, a special message if you're implementing CQRS...

More stuff

Rebus comes with a few things in addition to the messaging library. They are listed here, along with words on how mature/immature they are, etc.

Changelog

Rebus now has a changelog in the repo: CHANGELOG.md