{"id":29704231,"url":"https://github.com/bookbeat/knightbus","last_synced_at":"2025-07-23T14:08:49.965Z","repository":{"id":34306811,"uuid":"153411829","full_name":"BookBeat/knightbus","owner":"BookBeat","description":"Fast multi-transport messaging framework ","archived":false,"fork":false,"pushed_at":"2025-06-18T14:29:02.000Z","size":1349,"stargazers_count":42,"open_issues_count":9,"forks_count":7,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-07-22T06:39:14.252Z","etag":null,"topics":["azure-service-bus","azure-storage","middleware","netstandard","pubsub","servicebus"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BookBeat.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2018-10-17T07:11:35.000Z","updated_at":"2025-06-11T08:03:41.000Z","dependencies_parsed_at":"2023-01-15T06:15:53.084Z","dependency_job_id":"0ff535b8-313d-4f8d-8458-7d3b23cef530","html_url":"https://github.com/BookBeat/knightbus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BookBeat/knightbus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BookBeat%2Fknightbus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BookBeat%2Fknightbus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BookBeat%2Fknightbus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BookBeat%2Fknightbus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BookBeat","download_url":"https://codeload.github.com/BookBeat/knightbus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BookBeat%2Fknightbus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266691580,"owners_count":23969182,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["azure-service-bus","azure-storage","middleware","netstandard","pubsub","servicebus"],"created_at":"2025-07-23T14:08:49.143Z","updated_at":"2025-07-23T14:08:49.949Z","avatar_url":"https://github.com/BookBeat.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KnightBus\n\n![Build status](https://github.com/BookBeat/knightbus/actions/workflows/dotnet.yaml/badge.svg?branch=master)\n[![NuGet](https://img.shields.io/nuget/v/KnightBus.Core.svg)](https://www.nuget.org/packages/KnightBus.Core/)\n[![Documentation Status](https://readthedocs.org/projects/knightbus/badge/?version=latest)](https://knightbus.readthedocs.io/en/latest/?badge=latest)\n\n## KnightBus is a fast, lightweight and extensible messaging framework that supports multiple active message transports\n\n\n[Find the official KnightBus documentation here](https://knightbus.readthedocs.io/)\n\n\u003cimg src=\"documentation/media/images/knightbus-logo.png\" alt=\"KnightBus Logo\" width=\"300\"/\u003e\n\n## Transports\n| Package                                                                                                        | NuGet                                                                                                                                                                                       |\n|----------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [KnightBus.Azure.ServiceBus](https://www.nuget.org/packages/KnightBus.Azure.ServiceBus/)                       | [![KnightBus.Azure.ServiceBus](https://img.shields.io/nuget/v/KnightBus.Azure.ServiceBus.svg)](https://www.nuget.org/packages/KnightBus.Azure.ServiceBus/)                                  |\n| [KnightBus.Azure.ServiceBus.Messages](https://www.nuget.org/packages/KnightBus.Azure.ServiceBus.Messages/)     | [![KnightBus.Azure.ServiceBus.Messages](https://img.shields.io/nuget/v/KnightBus.Azure.ServiceBus.Messages.svg)](https://www.nuget.org/packages/KnightBus.Azure.ServiceBus.Messages/)       |\n| [KnightBus.Azure.ServiceBus.Management](https://www.nuget.org/packages/KnightBus.Azure.ServiceBus.Management/) | [![KnightBus.Azure.ServiceBus.Management](https://img.shields.io/nuget/v/KnightBus.Azure.ServiceBus.Management.svg)](https://www.nuget.org/packages/KnightBus.Azure.ServiceBus.Management/) |\n| [KnightBus.Azure.Storage](https://www.nuget.org/packages/KnightBus.Azure.Storage/)                             | [![KnightBus.Azure.Storage](https://img.shields.io/nuget/v/KnightBus.Azure.Storage.svg)](https://www.nuget.org/packages/KnightBus.Azure.Storage/)                                           |\n| [KnightBus.Azure.Storage.Management](https://www.nuget.org/packages/KnightBus.Azure.Storage.Management/)                 | [![KnightBus.Azure.Storage.Management](https://img.shields.io/nuget/v/KnightBus.Azure.Storage.Management.svg)](https://www.nuget.org/packages/KnightBus.Azure.Storage.Management/)                    |\n| [KnightBus.Azure.Storage.Messages](https://www.nuget.org/packages/KnightBus.Azure.Storage.Messages/)           | [![KnightBus.Azure.Storage.Messages](https://img.shields.io/nuget/v/KnightBus.Azure.Storage.Messages.svg)](https://www.nuget.org/packages/KnightBus.Azure.Storage.Messages/)                |\n| [KnightBus.Redis](https://www.nuget.org/packages/KnightBus.Redis/)                                             | [![KnightBus.Redis](https://img.shields.io/nuget/v/KnightBus.Redis.svg)](https://www.nuget.org/packages/KnightBus.Redis/)                                                                   |\n| [KnightBus.Redis.Messages](https://www.nuget.org/packages/KnightBus.Redis.Messages/)                           | [![KnightBus.Redis.Messages](https://img.shields.io/nuget/v/KnightBus.Redis.Messages.svg)](https://www.nuget.org/packages/KnightBus.Redis.Messages/)                                        |\n| [KnightBus.Nats](https://www.nuget.org/packages/KnightBus.Nats/)                                               | [![KnightBus.Nats](https://img.shields.io/nuget/v/KnightBus.Nats.svg)](https://www.nuget.org/packages/KnightBus.Nats/)                                                                      |\n| [KnightBus.Nats.Messages](https://www.nuget.org/packages/KnightBus.Nats.Messages/)                             | [![KnightBus.Nats.Messages](https://img.shields.io/nuget/v/KnightBus.Nats.Messages.svg)](https://www.nuget.org/packages/KnightBus.Nats.Messages/)                                           |\n| [KnightBus.PostgreSql](https://www.nuget.org/packages/KnightBus.PostgreSql/)                                   | [![KnightBus.PostgreSql](https://img.shields.io/nuget/v/KnightBus.PostgreSql.svg)](https://www.nuget.org/packages/KnightBus.PostgreSql/)                                                    |\n| [KnightBus.PostgreSql.Messages](https://www.nuget.org/packages/KnightBus.PostgreSql.Messages/)                 | [![KnightBus.PostgreSql.Messages](https://img.shields.io/nuget/v/KnightBus.PostgreSql.Messages.svg)](https://www.nuget.org/packages/KnightBus.PostgreSql.Messages/)                         |\n| [KnightBus.PostgreSql.Management](https://www.nuget.org/packages/KnightBus.PostgreSql.Management/)             | [![KnightBus.PostgreSql.Management](https://img.shields.io/nuget/v/KnightBus.PostgreSql.Management.svg)](https://www.nuget.org/packages/KnightBus.PostgreSql.Management/)                   |\n\n## Monitoring\n| Package                                                                                                    | NuGet                                                                                                                                                                                 |\n|------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [KnightBus.ApplicationInsights](https://www.nuget.org/packages/KnightBus.ApplicationInsights/)             | [![KnightBus.ApplicationInsights](https://img.shields.io/nuget/v/KnightBus.ApplicationInsights.svg)](https://www.nuget.org/packages/KnightBus.ApplicationInsights/)                   |\n| [KnightBus.NewRelic](https://www.nuget.org/packages/KnightBus.NewRelic/)                                   | [![KnightBus.NewRelic](https://img.shields.io/nuget/v/KnightBus.NewRelic.svg)](https://www.nuget.org/packages/KnightBus.NewRelic/)                                                    |\n\n## Serialization\n| Package                                                                                                    | NuGet                                                                                                                                                                                 |\n|------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [KnightBus.Newtonsoft](https://www.nuget.org/packages/KnightBus.Newtonsoft/)                               | [![KnightBus.Newtonsoft](https://img.shields.io/nuget/v/KnightBus.Newtonsoft.svg)](https://www.nuget.org/packages/KnightBus.Newtonsoft/)                                              |\n\n## Framework\n| Package                                                                         | NuGet                                                                                                                                                                                 |\n|---------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [KnightBus.Host](https://www.nuget.org/packages/KnightBus.Host/)                | [![KnightBus.Host](https://img.shields.io/nuget/v/KnightBus.Host.svg)](https://www.nuget.org/packages/KnightBus.Host/)                                                                |\n| [KnightBus.Core](https://www.nuget.org/packages/KnightBus.Core/)                | [![KnightBus.Core](https://img.shields.io/nuget/v/KnightBus.Core.svg)](https://www.nuget.org/packages/KnightBus.Core/)                                                                |\n| [KnightBus.Core.Management](https://www.nuget.org/packages/KnightBus.Core.Management/) | [![KnightBus.Core.Management](https://img.shields.io/nuget/v/KnightBus.Core.Management.svg)](https://www.nuget.org/packages/KnightBus.Core.Management/)                                                    |\n| [KnightBus.Messages](https://www.nuget.org/packages/KnightBus.Messages/)        | [![KnightBus.Messages](https://img.shields.io/nuget/v/KnightBus.Messages.svg)](https://www.nuget.org/packages/KnightBus.Messages/)                                                    |\n| [KnightBus.SqlServer](https://www.nuget.org/packages/KnightBus.SqlServer/)      | [![KnightBus.SqlServer](https://img.shields.io/nuget/v/KnightBus.SqlServer.svg)](https://www.nuget.org/packages/KnightBus.SqlServer/)                                                 |\n| [KnightBus.Schedule](https://www.nuget.org/packages/KnightBus.Schedule/)        | [![KnightBus.Schedule](https://img.shields.io/nuget/v/KnightBus.Schedule.svg)](https://www.nuget.org/packages/KnightBus.Schedule/)                                                    |\n\n## Message Processing\n```csharp\npublic class CommandProcessor : IProcessCommand\u003cSampleCommand, SampleSettings\u003e,\n{\n    public CommandProcessor(ISomeDependency dependency)\n    {\n        //You can use your own container for dependency injection\n    }\n\n    public Task ProcessAsync(SampleCommand message, CancellationToken cancellationToken)\n    {\n        //Your code goes here\n        return Task.CompletedTask;\n    }\n}\n```\n\n## Initialization\n```csharp\nclass Program\n{\n    static async Task Main(string[] args)\n    {\n            var host = Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder(args)\n            .ConfigureServices(services =\u003e\n            {\n                //Multiple active transports\n                services.UseServiceBus(config =\u003e config.ConnectionString = \"sb-connection\")\n                        .UseTransport\u003cServiceBusTransport\u003e()\n                        .UseBlobStorage(config =\u003e config.ConnectionString = \"storage-connection\")\n                        .UseTransport\u003cStorageTransport\u003e()\n                        .RegisterProcessors();\n            })\n            .UseKnightBus().Build();                \n\n            await host.StartAsync(CancellationToken.None);\n    }\n}\n```\n\n## Bring your own Middleware\n\nKnightBus supports inserting your own middleware into the execution pipeline.\n\n```csharp\npublic class CustomThrottlingMiddleware : IMessageProcessorMiddleware\n    {\n        private readonly SemaphoreQueue _semaphoreQueue;\n        public int CurrentCount =\u003e _semaphoreQueue.CurrentCount;\n\n        public CustomThrottlingMiddleware(int maxConcurrent)\n        {\n            _semaphoreQueue = new SemaphoreQueue(maxConcurrent);\n        }\n        public async Task ProcessAsync\u003cT\u003e(IMessageStateHandler\u003cT\u003e messageStateHandler, IPipelineInformation pipelineInformation, IMessageProcessor next, CancellationToken cancellationToken) where T : class, IMessage\n        {\n            try\n            {\n                await _semaphoreQueue.WaitAsync().ConfigureAwait(false);\n                await next.ProcessAsync(messageStateHandler, cancellationToken).ConfigureAwait(false);\n            }\n            finally\n            {\n                _semaphoreQueue.Release();\n            }\n        }\n    }\n```\n\n## Write your own Plugin\n\nKnightBus supports custom plugins. Examples of existing plugins are: TcpAliveListener (K8S liveness probes) and Scheduling (Chron triggers). \n\n```csharp\npublic class CustomPlugin : IPlugin\n{\n    public CustomPlugin(ISomeDependency dependency, ILogger\u003cCustomPlugin\u003e logger)\n    {        \n    }\n\n    public async Task StartAsync(CancellationToken cancellationToken)\n    {\n        // Start the plugin\n    }\n}\n```\n\n## Documentation\n\nTo get documentation up and running locally, do the following.\n\n1. Install `sphinx`: https://www.sphinx-doc.org\n2. Install `sphinx_rtd_theme`: https://github.com/readthedocs/sphinx_rtd_theme\n3. Run `make html source build` in the documentation folder\n4. Open `documentation/build/html/index.html` in a browser to preview your changes\n\nFor Linux:\n\n```console\n# In documentation folder:\n\n$ sudo apt install python3 python3-sphinx python3-pip\n$ python3 -m pip install sphinx-rtd-theme\n$ make html source build\n$ sensible-browser build/html/index.html\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbookbeat%2Fknightbus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbookbeat%2Fknightbus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbookbeat%2Fknightbus/lists"}