{"id":19383259,"url":"https://github.com/rebus-org/rebus.signalr","last_synced_at":"2025-04-23T21:31:38.804Z","repository":{"id":47210694,"uuid":"244329633","full_name":"rebus-org/Rebus.SignalR","owner":"rebus-org","description":":bus: Rebus-based SignalR backplane","archived":false,"fork":false,"pushed_at":"2023-11-15T13:31:15.000Z","size":1918,"stargazers_count":30,"open_issues_count":1,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-02T20:11:54.608Z","etag":null,"topics":["backplane","rebus","signalr"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rebus-org.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-02T09:23:18.000Z","updated_at":"2024-10-15T08:24:08.000Z","dependencies_parsed_at":"2024-11-10T09:26:04.610Z","dependency_job_id":null,"html_url":"https://github.com/rebus-org/Rebus.SignalR","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rebus-org%2FRebus.SignalR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rebus-org%2FRebus.SignalR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rebus-org%2FRebus.SignalR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rebus-org%2FRebus.SignalR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rebus-org","download_url":"https://codeload.github.com/rebus-org/Rebus.SignalR/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250517751,"owners_count":21443836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backplane","rebus","signalr"],"created_at":"2024-11-10T09:25:14.697Z","updated_at":"2025-04-23T21:31:38.794Z","avatar_url":"https://github.com/rebus-org.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rebus.SignalR\n\n[![install from nuget](https://img.shields.io/nuget/v/Rebus.SignalR.svg?style=flat-square)](https://www.nuget.org/packages/Rebus.SignalR)\n\nRebus-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.\n\nHow to use\n====\nJust add AddRebusBackplane\u0026lt;THub\u0026gt;() method call for each hub, that you're going to use with Rebus.SignalR backplane.\n```csharp\nservices.AddSignalR()\n    .AddRebusBackplane\u003cChatHub\u003e();\n```\n \nConfigure Rebus IBus as usual, but keep in mind several things:\n* 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. \n* Enable Rebus.Async with EnableSynchronousRequestReply() method call, if you're going to use AddToGroupAsync() and RemoveFromGroupAsync() in SignalR hubs.\n* 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\u0026lt;THub\u0026gt;() extension method for type-based router: \n\nSample application 1 (RabbitMq is used as a transport with the centralized subscription storage)\n====\nIf 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](https://hub.docker.com/search?q=\u0026type=edition\u0026offering=community\u0026sort=updated_at\u0026order=desc) command from the root repository directory:\n```\ndocker-compose up\n```\n\n```csharp\nprivate static string GenerateTransientQueueName(string inputQueueName)\n{\n    return $\"{inputQueueName}-{Environment.MachineName}-{Guid.NewGuid().ToString()}\";\n}\n\npublic void ConfigureServices(IServiceCollection services)\n{\n    services.AddSignalR()\n        .AddRebusBackplane\u003cChatHub\u003e();\n\n    var rabbitMqOptions = Configuration.GetSection(nameof(RabbitMqOptions)).Get\u003cRabbitMqOptions\u003e();\n            \n    var rabbitMqConnectionString =\n        $\"amqp://{rabbitMqOptions.User}:{rabbitMqOptions.Password}@{rabbitMqOptions.Host}:{rabbitMqOptions.Port.ToString()}\";\n\n    services.AddRebus(configure =\u003e configure\n        .Transport(x =\u003e\n        {\n            x.UseRabbitMq(rabbitMqConnectionString, GenerateTransientQueueName(\"Rebus.SignalR\"))\n            .InputQueueOptions(o =\u003e\n            {\n                o.SetAutoDelete(true);\n                o.SetDurable(false);\n            });\n        })\n        .Options(o =\u003e o.EnableSynchronousRequestReply())\n        .Routing(r =\u003e r.TypeBased()));\n}\n```\n\nSample application 2 (SQL Server is used as a transport with the decentralized subscription storage)\n====\nYou can modify Rebus.SignalR.Samples application to try out SqlServer transport:\n```csharp\npublic void ConfigureServices(IServiceCollection services)\n{\n\tservices.AddSignalR()\n        .AddRebusBackplane\u003cChatHub\u003e();\n\n\tvar queueName = GenerateTransientQueueName(\"Rebus.SignalR\");\n\tservices.AddRebus(configure =\u003e configure\n\t\t.Transport(x =\u003e x.UseSqlServer(SignalRBackplaneConnectionString, queueName, isCentralized: false))\n        .Options(o =\u003e o.EnableSynchronousRequestReply())\n        .Routing(r =\u003e r.TypeBased()\n            .MapSignalRCommands\u003cChatHub\u003e(queueName))\n\t\t.Subscriptions(s =\u003e s.StoreInSqlServer(SignalRBackplaneConnectionString, \"Subscriptions\", false)));                    \n}\n```\n\n![](https://raw.githubusercontent.com/rebus-org/Rebus/master/artwork/little_rebusbus2_copy-200x200.png)\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frebus-org%2Frebus.signalr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frebus-org%2Frebus.signalr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frebus-org%2Frebus.signalr/lists"}