Rebus.SignalR 1.0.0

dotnet add package Rebus.SignalR --version 1.0.0
NuGet\Install-Package Rebus.SignalR -Version 1.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.SignalR" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rebus.SignalR --version 1.0.0
#r "nuget: Rebus.SignalR, 1.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.
// Install Rebus.SignalR as a Cake Addin
#addin nuget:?package=Rebus.SignalR&version=1.0.0

// Install Rebus.SignalR as a Cake Tool
#tool nuget:?package=Rebus.SignalR&version=1.0.0

Rebus.SignalR

install from nuget

Rebus-based SignalR backplane is useful, if you are using Rebus already and/or would like to leverage Rebus' integration with various transports not supported by SignalR's own backplane integrations.

How to use

Just add AddRebusBackplane<THub>() method call for each hub, that you're going to use with Rebus.SignalR backplane.

services.AddSignalR()
    .AddRebusBackplane<ChatHub>();

Configure Rebus IBus as usual, but keep in mind several things:

  • Use an auto generated unique name for the input queue, that will be used as a backplane. In case of Rebus.RabbitMq you should probably configure the input queue as auto-delete.
  • Enable Rebus.Async with EnableSynchronousRequestReply() method call, if you're going to use AddToGroupAsync() and RemoveFromGroupAsync() in SignalR hubs.
  • If you're using a decentralized subscription storage, for example Sql Server configured with isCentralized option set to false (by default), you have to map Rebus.SignalR backplane commands for each hub to your queue. To do that, just call MapSignalRCommands<THub>() extension method for type-based router:

Sample application 1 (RabbitMq is used as a transport with the centralized subscription storage)

If you have RabbitMq already installed locally, you can run Rebus.SignalR.Samples from your IDE or using "dotnet run" command. Another option is to use Docker Compose command from the root repository directory:

docker-compose up
private static string GenerateTransientQueueName(string inputQueueName)
{
    return $"{inputQueueName}-{Environment.MachineName}-{Guid.NewGuid().ToString()}";
}

public void ConfigureServices(IServiceCollection services)
{
    services.AddSignalR()
        .AddRebusBackplane<ChatHub>();

    var rabbitMqOptions = Configuration.GetSection(nameof(RabbitMqOptions)).Get<RabbitMqOptions>();
            
    var rabbitMqConnectionString =
        $"amqp://{rabbitMqOptions.User}:{rabbitMqOptions.Password}@{rabbitMqOptions.Host}:{rabbitMqOptions.Port.ToString()}";

    services.AddRebus(configure => configure
        .Transport(x =>
        {
            x.UseRabbitMq(rabbitMqConnectionString, GenerateTransientQueueName("Rebus.SignalR"))
            .InputQueueOptions(o =>
            {
                o.SetAutoDelete(true);
                o.SetDurable(false);
            });
        })
        .Options(o => o.EnableSynchronousRequestReply())
        .Routing(r => r.TypeBased()));
}

Sample application 2 (SQL Server is used as a transport with the decentralized subscription storage)

You can modify Rebus.SignalR.Samples application to try out SqlServer transport:

public void ConfigureServices(IServiceCollection services)
{
	services.AddSignalR()
        .AddRebusBackplane<ChatHub>();

	var queueName = GenerateTransientQueueName("Rebus.SignalR");
	services.AddRebus(configure => configure
		.Transport(x => x.UseSqlServer(SignalRBackplaneConnectionString, queueName, isCentralized: false))
        .Options(o => o.EnableSynchronousRequestReply())
        .Routing(r => r.TypeBased()
            .MapSignalRCommands<ChatHub>(queueName))
		.Subscriptions(s => s.StoreInSqlServer(SignalRBackplaneConnectionString, "Subscriptions", false)));                    
}

alternate text is missing from this package README image


Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 1,477 11/15/2023
1.0.0-alpha01 129 3/29/2023
0.0.6 5,506 9/9/2021
0.0.5 42,626 3/24/2020
0.0.4 442 3/12/2020
0.0.3 439 3/6/2020
0.0.2 411 3/5/2020
0.0.1 459 3/5/2020