Rebus.Autofac 9.0.0

dotnet add package Rebus.Autofac --version 9.0.0
                    
NuGet\Install-Package Rebus.Autofac -Version 9.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rebus.Autofac" Version="9.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rebus.Autofac" Version="9.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Rebus.Autofac" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rebus.Autofac --version 9.0.0
                    
#r "nuget: Rebus.Autofac, 9.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rebus.Autofac@9.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rebus.Autofac&version=9.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Rebus.Autofac&version=9.0.0
                    
Install as a Cake Tool

Rebus.Autofac

install from nuget

Provides an Autofac container adapter for Rebus.

alternate text is missing from this package README image


Use the Autofac container adapter like this:

var builder = new ContainerBuilder();

builder.RegisterRebus((configurer, context) => configurer
    .Logging(l => l.Serilog())
    .Transport(t => t.UseRabbitMq(...))
    .Options(o => {
        o.SetNumberOfWorkers(2);
        o.SetMaxParallelism(30);
    }));

// the bus is registered now, but it has not been started.... make all your other registrations, and then:
var container = builder.Build(); //< start the bus


// now your application is running


// ALWAYS do this when your application shuts down:
container.Dispose();

It will automatically register the following services in Autofac:

  • IBus – this is the bus singleton
  • IBusStarter – this is the bus starter you can use to start it manually
  • IMessageContext – this is the current message context – can be injected into Rebus message handlers and everything resolved at the time of receiving a new message
  • ISyncBus – this is the synchronous bus instance – can be used in places, where a Task-based asynchronous API is not desired, e.g. from deep within ASP.NET or WPF applications, which would deadlock if you went .Wait() on a Task

Not that if you wish to regiser the bus and not start it automatically, you can stil register the number of workers but have it not start anything until you are ready for the bus to be started. This is usefu if you wish to separate the processing of messages from the sending of messages (separate tasks, services etc). You would do it like this:

var builder = new ContainerBuilder();

builder.RegisterRebus((configurer, context) => configurer
    .Logging(l => l.Serilog())
    .Transport(t => t.UseRabbitMq(...))
    .Options(o => {
        o.SetNumberOfWorkers(2);
        o.SetMaxParallelism(30);
    }),
    false); // <--- here we tell it not to start the bus

// the bus is registered now, but it has not been started.... make all your other registrations, and then:
var container = builder.Build();
var busStarter = container.Resolve<IBusStarter>();
busStarter.Start(); //< start the bus


// now your application is running


// ALWAYS do this when your application shuts down:
container.Dispose();
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Rebus.Autofac:

Package Downloads
Vedaantees.Framework.Providers

Providers implementation for the framework.

GAPD.Common.Event

Package Description

Imget.Shared

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.0.0 3,806,710 11/15/2023
9.0.0-alpha03 750 8/2/2023
9.0.0-alpha01 684 3/27/2023
8.0.0 676,655 2/3/2022
7.3.0 143,286 9/20/2021
7.2.0 66,523 2/25/2021
7.1.0 1,814 2/23/2021
7.0.0 187,014 1/31/2020
6.0.0 102,016 1/31/2020
6.0.0-b10 1,091 1/30/2020
6.0.0-b09 2,016 11/4/2019
6.0.0-b08 3,810 8/9/2019
6.0.0-b07 4,785 6/21/2019
6.0.0-b05 1,184 6/21/2019
6.0.0-b04 1,840 11/15/2018
6.0.0-b03 1,418 11/15/2018
6.0.0-b02 1,428 11/9/2018
6.0.0-b01 2,153 1/10/2018
5.2.0 4,401,802 11/14/2017
5.1.0 2,219 11/13/2017
5.0.0 2,458 11/3/2017
5.0.0-b01 1,671 10/30/2017
4.0.0 27,960 8/15/2017
4.0.0-b08 2,722 6/22/2017
4.0.0-b07 1,876 5/18/2017
4.0.0-b06 1,679 5/17/2017
4.0.0-b05 1,674 5/17/2017
4.0.0-b04 1,746 4/19/2017
4.0.0-b03 1,689 4/5/2017
4.0.0-b02 2,984 4/4/2017
4.0.0-b01 1,705 3/21/2017
3.0.0 44,514 1/5/2017
2.0.0 17,549 9/20/2016
2.0.0-b01 1,691 9/9/2016
2.0.0-a2 1,710 8/31/2016
2.0.0-a1 1,721 8/31/2016
0.99.74 3,473 8/29/2016
0.99.73 2,185 8/12/2016
0.99.72 2,137 8/4/2016
0.99.71 2,347 8/3/2016
0.99.70 2,196 7/29/2016
0.99.68 2,141 7/18/2016
0.99.67 2,176 7/1/2016
0.99.66 2,148 6/28/2016
0.99.65 2,088 6/23/2016
0.99.64 2,137 6/22/2016
0.99.63 2,064 6/21/2016
0.99.62 2,146 6/17/2016
0.99.61 2,050 6/17/2016
0.99.60 2,168 6/15/2016
0.99.59 2,312 6/3/2016
0.99.58 3,166 5/24/2016
0.99.57 2,110 5/22/2016
0.99.56 2,171 5/22/2016
0.99.55 2,299 5/16/2016
0.99.54 2,106 5/12/2016
0.99.53 2,036 5/12/2016
0.99.52 2,142 5/11/2016
0.99.51 2,121 5/9/2016
0.99.50 2,275 4/13/2016
0.99.48 2,206 4/6/2016
0.99.47 2,131 3/31/2016
0.99.46 2,090 3/30/2016
0.99.45 2,106 3/29/2016
0.99.44 1,991 3/26/2016
0.99.43 2,022 3/26/2016
0.99.42 2,256 3/22/2016
0.99.41 2,161 3/17/2016
0.99.40 2,109 3/15/2016
0.99.39 2,114 3/14/2016
0.99.38 2,079 3/9/2016
0.99.37 2,070 3/9/2016
0.99.36 2,128 3/3/2016
0.99.35 2,150 2/22/2016
0.99.34 2,153 2/19/2016
0.99.33 2,386 2/12/2016
0.99.32 2,121 2/10/2016
0.99.31 2,057 2/8/2016
0.99.30 2,538 2/5/2016
0.99.29 2,734 2/2/2016
0.99.27 2,078 1/28/2016
0.99.26 2,057 1/27/2016
0.99.25 2,152 1/22/2016
0.99.24 2,165 1/18/2016
0.99.23 2,243 12/18/2015
0.99.22 2,095 12/18/2015
0.99.21 2,433 12/11/2015
0.99.20 2,338 12/10/2015
0.99.19 2,127 12/8/2015
0.99.18 2,142 12/7/2015
0.99.17 2,076 12/7/2015
0.99.16 2,449 11/30/2015
0.99.14 2,252 11/24/2015
0.99.13 2,215 11/23/2015
0.99.12 2,311 11/17/2015
0.99.11 2,121 11/17/2015
0.99.10 2,327 11/11/2015
0.99.9 2,135 11/5/2015
0.99.8 2,177 11/5/2015
0.99.7 2,146 10/29/2015
0.99.5 2,409 10/27/2015
0.99.4 2,095 10/27/2015
0.99.2 2,265 10/12/2015
0.99.1 2,206 10/8/2015
0.99.0 2,399 10/7/2015
0.98.12 2,177 9/17/2015
0.98.11 2,212 9/17/2015
0.98.10 2,179 9/16/2015
0.98.9 2,145 9/14/2015
0.98.8 2,172 9/13/2015
0.98.7 2,213 9/9/2015
0.98.6 2,196 9/7/2015
0.98.5 2,117 9/3/2015
0.98.4 2,090 9/3/2015
0.98.3 2,163 9/1/2015
0.98.2 2,136 8/27/2015
0.98.1 2,139 8/27/2015
0.98.0 2,145 8/26/2015
0.97.0 2,096 8/25/2015
0.96.0 2,106 8/24/2015
0.95.0 2,140 8/20/2015
0.94.0 2,141 8/19/2015
0.93.0 2,144 8/19/2015
0.92.4 2,162 8/17/2015
0.92.3 2,472 8/13/2015
0.92.2 2,635 8/12/2015
0.92.1 2,301 8/12/2015
0.92.0 2,361 8/11/2015
0.91.0 2,094 8/11/2015
0.90.9 2,126 8/10/2015
0.90.8 2,462 8/9/2015
0.90.7 2,364 8/5/2015
0.90.6 2,353 8/4/2015
0.90.5 2,347 8/4/2015
0.90.4 2,323 8/2/2015
0.90.3 2,326 8/2/2015
0.90.2 2,267 7/31/2015
0.90.1 2,300 7/29/2015
0.90.0 2,286 7/29/2015
0.84.0 2,811 5/15/2015
0.83.0 2,379 4/20/2015
0.82.1 2,223 4/16/2015
0.82.0 2,251 3/18/2015
0.81.0 2,104 3/12/2015
0.80.1 2,344 3/5/2015
0.80.0 2,840 2/19/2015
0.79.0 2,129 2/6/2015
0.78.2 2,074 2/6/2015
0.78.1 2,107 2/5/2015
0.78.0 2,231 1/29/2015
0.77.1 2,158 1/23/2015
0.77.0 2,153 1/15/2015
0.76.0 2,128 1/15/2015
0.75.2 2,472 1/3/2015
0.75.1 2,544 12/21/2014
0.75.0 2,291 12/2/2014
0.74.1 2,303 12/2/2014
0.74.0 2,273 11/30/2014
0.73.0 3,436 11/6/2014
0.72.0 2,493 11/5/2014
0.71.4 2,333 10/29/2014
0.71.3 2,231 10/20/2014
0.71.2 2,136 9/30/2014
0.71.1 2,293 9/19/2014
0.71.0 2,270 8/7/2014
0.70.3 2,124 8/4/2014
0.70.2 2,582 7/31/2014
0.70.1 2,184 7/17/2014
0.69.0 2,413 6/17/2014
0.68.0 2,235 6/5/2014
0.67.0 2,247 5/20/2014
0.66.0 2,288 5/9/2014
0.65.0 2,420 4/27/2014
0.64.1 2,273 4/25/2014
0.64.0 2,397 4/20/2014
0.63.1 2,247 4/19/2014
0.63.0 2,224 3/24/2014
0.62.0 2,314 3/12/2014
0.61.1 2,252 3/5/2014
0.61.0 2,221 3/4/2014
0.60.1 2,203 3/3/2014
0.60.0 2,219 3/3/2014
0.59.0 2,325 2/26/2014
0.58.2 2,270 2/24/2014
0.58.1 2,233 2/24/2014
0.58.0 2,222 2/24/2014
0.57.0 2,226 2/18/2014
0.56.1 2,277 2/4/2014
0.56.0 2,231 1/24/2014
0.55.1 2,220 1/20/2014
0.55.0 2,290 1/20/2014
0.54.8 2,200 1/20/2014
0.54.7 2,233 1/20/2014
0.54.6 2,221 1/20/2014
0.54.5 2,228 1/20/2014
0.54.4 2,293 1/11/2014
0.54.3 2,205 1/8/2014
0.54.1 2,244 12/16/2013
0.54.0 2,223 12/10/2013
0.53.1 2,243 12/9/2013
0.53.0 2,211 12/5/2013
0.52.0 2,185 12/4/2013
0.51.1 2,225 12/3/2013
0.51.0 2,284 12/3/2013
0.50.1 2,275 11/15/2013
0.50.0 2,243 11/15/2013
0.49.0 2,283 11/15/2013
0.48.0 2,214 11/12/2013
0.47.0 2,221 11/6/2013
0.46.0 2,244 10/29/2013
0.45.0 2,192 10/21/2013
0.44.5 2,238 10/11/2013
0.44.4 2,228 10/7/2013
0.44.3 2,208 10/4/2013
0.44.2 2,229 10/4/2013
0.44.1 2,271 10/2/2013
0.44.0 2,242 10/2/2013
0.43.1 2,236 9/24/2013
0.43.0 2,227 9/17/2013
0.42.0 2,234 9/17/2013
0.41.0 2,315 9/10/2013
0.40.1 2,291 9/9/2013
0.40.0 2,263 9/2/2013
0.39.0 2,286 8/29/2013
0.38.1 2,226 8/28/2013
0.38.0 2,226 8/28/2013
0.37.0 2,220 8/26/2013
0.36.1 2,273 8/25/2013
0.36.0 2,337 8/25/2013
0.35.6 2,249 8/20/2013
0.35.5 2,247 8/20/2013
0.35.4 2,322 8/19/2013
0.35.3 2,269 8/17/2013
0.35.2 2,324 8/15/2013
0.35.1 2,257 8/14/2013
0.35.0 2,246 8/6/2013
0.34.7 2,167 8/5/2013
0.34.6 2,296 8/5/2013
0.34.5 2,236 8/2/2013
0.34.3 2,229 7/29/2013
0.34.2 2,197 7/29/2013
0.34.1 2,307 7/27/2013
0.34.0 2,499 7/4/2013
0.33.0 2,413 6/14/2013
0.32.4 2,258 5/28/2013
0.32.3 2,241 5/23/2013
0.32.1 2,287 5/15/2013
0.32.0 2,326 4/23/2013
0.31.1 2,284 4/2/2013
0.31.0 2,243 4/2/2013
0.30.7 2,284 3/25/2013
0.30.4 2,328 3/7/2013
0.30.3 2,235 3/7/2013
0.30.2 2,302 3/7/2013
0.30.1 2,287 3/6/2013
0.30.0 2,350 3/5/2013
0.29.9 2,307 3/5/2013
0.29.8 2,342 3/5/2013
0.29.7 2,292 2/28/2013
0.29.6 2,304 2/20/2013
0.29.5 2,298 2/20/2013
0.29.4 2,261 2/8/2013
0.29.3 2,260 2/6/2013
0.29.1 2,256 2/5/2013
0.29.0-alpha 1,736 1/22/2013
0.28.4 2,313 1/21/2013
0.28.3 2,342 1/8/2013
0.28.2 2,258 1/8/2013
0.28.1 2,297 12/27/2012
0.28.0 2,311 12/27/2012
0.27.1 2,331 12/4/2012
0.27.0 2,371 12/4/2012
0.26.1 2,486 12/4/2012
0.26.0 2,466 11/20/2012
0.25.9 2,574 11/20/2012
0.25.8 2,513 11/19/2012
0.25.7 2,552 11/18/2012
0.25.5 2,492 11/15/2012
0.25.3 2,506 11/13/2012
0.25.2 2,517 11/13/2012
0.25.1 2,500 11/13/2012
0.25.0 2,512 11/7/2012
0.24.9 2,436 11/7/2012
0.24.8 2,439 11/7/2012
0.24.7 2,450 11/6/2012
0.24.6 2,464 11/1/2012
0.24.5 2,484 10/30/2012
0.24.4 2,464 10/30/2012
0.24.3 2,458 10/26/2012
0.24.2 2,390 10/26/2012
0.24.1 2,418 10/26/2012
0.24.0 2,445 10/25/2012
0.23.9 2,448 10/25/2012
0.23.8 2,417 10/25/2012
0.23.7 2,411 10/25/2012
0.23.6 2,446 10/24/2012
0.23.1 2,370 10/12/2012
0.23.0 2,465 10/10/2012
0.22.8 2,375 10/10/2012
0.22.7 2,389 10/9/2012
0.22.6 2,448 10/9/2012
0.22.5 2,388 10/3/2012
0.22.4 2,325 10/2/2012
0.22.3 2,294 10/2/2012
0.22.2 2,343 9/30/2012
0.22.1 2,371 9/26/2012
0.22.0 2,394 9/26/2012
0.21.7 2,411 9/25/2012
0.21.6 2,361 9/25/2012
0.21.5 2,423 9/11/2012
0.21.4 2,414 9/10/2012
0.21.3 2,392 9/10/2012
0.21.2 2,321 9/10/2012
0.21.1 2,342 9/10/2012
0.21.0 2,297 9/7/2012
0.20.9 2,303 9/7/2012
0.20.8 2,390 9/6/2012
0.20.7 2,362 9/6/2012
0.20.6 2,396 9/6/2012
0.20.3 2,385 9/4/2012
0.20.2 2,326 9/4/2012
0.19.7 2,465 8/29/2012
0.19.6 2,380 8/28/2012
0.19.5 2,407 8/28/2012
0.19.4 2,306 8/28/2012
0.19.3 2,280 8/28/2012
0.19.2 2,353 8/28/2012
0.19.1 2,343 8/26/2012
0.18.6 2,332 8/23/2012
0.16.0 2,370 8/20/2012
0.15.9-alpha 1,887 8/14/2012
0.15.8-alpha 1,850 8/8/2012
0.15.7-alpha 1,847 8/8/2012
0.15.6-alpha 1,805 8/8/2012
0.15.5-alpha 1,892 8/8/2012
0.15.4-alpha 1,845 8/7/2012
0.15.3-alpha 1,831 8/7/2012
0.15.2-alpha 1,879 8/7/2012
0.15.1-alpha 1,859 8/2/2012
0.15.0-alpha 1,883 8/1/2012
0.14.0-alpha 1,864 7/30/2012
0.13.0-alpha 1,847 7/14/2012
0.12.9-alpha 1,969 6/18/2012
0.12.8-alpha 1,832 6/18/2012
0.12.7-alpha 1,832 6/13/2012
0.12.6-alpha 1,833 6/8/2012
0.12.5-alpha 1,867 6/5/2012
0.12.4-alpha 1,831 6/5/2012
0.12.3-alpha 1,814 6/1/2012
0.12.2-alpha 1,852 5/31/2012
0.12.1-alpha 1,852 5/30/2012
0.11.10-alpha 1,877 5/30/2012
0.11.9-alpha 1,791 5/30/2012
0.11.8-alpha 1,801 5/30/2012
0.11.7-alpha 1,885 5/30/2012
0.11.6-alpha 1,825 5/29/2012
0.11.5-alpha 1,848 5/22/2012
0.11.4-alpha 1,851 5/22/2012