{"id":19414905,"url":"https://github.com/omid-ahmadpour/neobus","last_synced_at":"2025-04-24T12:32:19.005Z","repository":{"id":38414962,"uuid":"346130878","full_name":"omid-ahmadpour/NeoBus","owner":"omid-ahmadpour","description":"A Bus for sending command, query and event using CQRS in .NET.","archived":false,"fork":false,"pushed_at":"2024-05-19T09:29:21.000Z","size":135,"stargazers_count":14,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-20T08:07:29.888Z","etag":null,"topics":["bus","command","command-query-pattern","cqrs-pattern","event","eventbus","query"],"latest_commit_sha":null,"homepage":"","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/omid-ahmadpour.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2021-03-09T20:08:57.000Z","updated_at":"2024-05-19T09:15:15.000Z","dependencies_parsed_at":"2024-05-19T09:41:25.860Z","dependency_job_id":"2f4325e8-6447-488b-be61-773b43ec52af","html_url":"https://github.com/omid-ahmadpour/NeoBus","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omid-ahmadpour%2FNeoBus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omid-ahmadpour%2FNeoBus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omid-ahmadpour%2FNeoBus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omid-ahmadpour%2FNeoBus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omid-ahmadpour","download_url":"https://codeload.github.com/omid-ahmadpour/NeoBus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223954360,"owners_count":17231187,"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":["bus","command","command-query-pattern","cqrs-pattern","event","eventbus","query"],"created_at":"2024-11-10T12:40:53.348Z","updated_at":"2024-11-10T12:40:53.919Z","avatar_url":"https://github.com/omid-ahmadpour.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NeoBus\nNeoBus is a powerful library that enables you to send commands, queries, and events using the CQRS pattern in .NET. It simplifies the implementation of distributed systems and event-driven architectures by seamlessly integrating with Kafka. If you find NeoBus helpful, please consider giving it a star ⭐ to show your support.\n\n## Installation\nYou can easily install NeoBus via NuGet Package Manager:\n\n```shell\n\u003e Install-Package NeoBus\n```\n\n## Configuration\nTo configure NeoBus, add the following settings to your `appsettings.json` file and specify your Kafka server address:\n\n```json\n\"NeoBus\": {\n    \"Kafka\": {\n        \"Servers\": [\"localhost:9092\"]\n    }\n}\n```\n\n## Registration\nIncorporate NeoBus into your project by registering it in the `Startup.cs` file within the `ConfigureServices` method:\n\n```csharp\nservices.AddNeoBus(Assembly.GetExecutingAssembly());\n```\n\n### Distributed Events (Kafka)\nFor distributed events using Kafka, register the necessary services as follows:\n\n```csharp\nservices.AddHostedService\u003cKafkaEventSubscriberService\u003cProductAddedEventOnKafka, ProductAddedEventOnKafkaHandler\u003e\u003e();\nservices.AddSingleton\u003cProductAddedEventOnKafkaHandler\u003e();\n```\n\nIf you are using a version lower than 1.2.0, use the following code to register and manually register commands and queries:\n\n```csharp\nservices.AddNeoBus();\n```\n\n### Registering Commands, Queries, and In-Memory Events\nTo register commands and queries, follow these steps:\n\n#### Command and Query Handlers:\n```csharp\nservices.AddScoped\u003cIRequestHandler\u003cProductAddCommand, CommandResult\u003e, ProductAddCommandHandler\u003e();\nservices.AddScoped\u003cIRequestHandler\u003cGetProductQuery, CommandResult\u003e, GetProductQueryHandler\u003e();\n```\n\n#### In-Memory Event Handlers:\n```csharp\nservices.AddScoped\u003cINotificationHandler\u003cProductAddedEvent\u003e, ProductAddedEventHandler\u003e();\n```\n\n## Sample Project\nExplore a sample project that demonstrates how to use NeoBus:\n\n[Sample For Use NeoBus](https://github.com/omid-ahmadpour/NeoBus/tree/main/Sample/SampleForUseNeoBus)\n\n## Setting Up Kafka with Docker Compose\nTo run Kafka locally, follow these instructions:\n\n1. Install Docker on your local machine.\n2. Download the `docker-compose-kafka.yml` file from within the project solution.\n3. Open your Terminal as an administrator.\n4. Navigate to the directory containing the `docker-compose-kafka.yml` file.\n5. Run the following command:\n\n```shell\ndocker-compose -f docker-compose-kafka.yml up\n```\n\nNow Kafka is up and running in a Docker container.\n\n## Learn More\nFor more information about NeoBus and its applications, consider reading the following articles:\n\n1. [EventBus Application and Introduction of NeoBus Package](https://medium.com/@omid-ahmadpour/eventbus-application-and-introduction-of-neobus-package-c22029d07f4)\n2. [کاربرد EventBus و معرفی پکیج NeoBus (Persian)](https://virgool.io/@ahmadpooromid/%DA%A9%D8%A7%D8%B1%D8%A8%D8%AF-eventbus-%D9%88-%D9%85%D8%B9%D8%B1%D9%81%DB%8C-%D9%BE%DA%A9%DB%8C%D8%AC-neobus-rveoqqgefbmu)\n\nFeel free to explore these resources to enhance your understanding of NeoBus and its capabilities.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomid-ahmadpour%2Fneobus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomid-ahmadpour%2Fneobus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomid-ahmadpour%2Fneobus/lists"}