SimpleMessageBus is a system for making applications more reliable and responsive to users by processing potentially long-running tasks out-of-band from the user's main workflow. It is designed to run either on-prem, or in the Microsoft Cloud, making it suitable for any application, and able to grow as your needs do.
- Allows you to build more user-responsive apps.
- Increases testability by decoupling long-latency events from UI-generated workflows.
- Pushes third-party dependencies to the edges of your app, streamlining deployments.
- Increases fault-tolerance by allowing you to easily track and replay failed messages.
Project | Release | Latest | Description |
---|---|---|---|
SimpleMessageBus.Core | Core components to provide messaging and file operations capabilities for On-Prem and Cloud environments. | ||
SimpleMessageBus.Dispatch | Messaging integration components with Azure WebJobs SDK dependency to accept and direct messages to proper message handler(s). | ||
SimpleMessageBus.Hosting | Configuration components to allow selection of hosting type (i.e: WindowsService vs. Console). | ||
SimpleMessageBus.Publish | Publishing integration component with Azure Queue Storag dependency to allow messages to be "put" on queues |
The SimpleMessageBus Architecture
SimpleMessageBus consists of two main parts:
- Manages the process of putting "messages" on the queue.
- Very lightweight, minimal dependencies.
- Straightforward configuration with Dependency Injection extensions.
- Runs in a separate process using the Azure WebJobs SDK.
- Manages messages coming off the queue and directs them to the proper message handler(s) to be processed.
- Allows multiple handlers to process the same message.
- Straightforward configuration with Dependency Injection extensions.
- Can run in the following environments:
- Console app (cross platform)
- Windows Service
- Azure WebJobs (Azure's web app offering)
- Azure Functions (Azure's "serverless" offering)
SimpleMessageBus currently supports two backing queues: the local file system, and Azure Storage Queues. This allows the Dispatcher to run entirely on-prem with no Azure dependencies, but still get the same durability and reliability through local poison queues and completed event storage.
SimpleMessageBus was designed to streamline the following scenarios:
- User-created long-latency events (post-registration emails, share notifications, etc)
- Incoming webhook processing (Stripe, SendGrid, GitHub, etc)
- Very-long-running tasks (batch processing, cron jobs, etc)
You can read more about these scenarios in our blog post.
The process of getting SimpleMessageBus working in your app is as easy as the name suggests.
- Create a new .NET Standard 2.0, .NET 6 or .NET 7 project to that will hold your defined Message types, install the
SimpleMessageBus.Core
NuGet package, and build out your Message types. - Install the
SimpleMessageBus.Publish
NuGet package into your app, reference the library you created in Step 1, and modify your workflows to publish Messages in response to events. - Create a new .NET Standard 2.0, .NET 6 or .NET 7 project that will hold your MessageHandlers, install the
SimpleMessageBus.Core
NuGet package, and build out your MessageHandlers. - Create a new Unit Test project, reference the library you created in Step 3, and test your MessageHandler library with a variety of synthetic Messages.
- Create a new Console project, install the
SimpleMessageBus.Dispatch
NuGet package, reference the library you created in Step 3, and inject your MessageHandlers into the DependencyInjection container.
Feel free to send us feedback on Twitter or file an issue. Feature requests are always welcome. If you wish to contribute, please take a quick look at the contribution guidelines.
Please adhere to our Code of Conduct during any interactions with CloudNimble team members and community members. It is strictly enforced on all official CloudNimble repositories, websites, and resources. If you encounter someone violating these terms, please let us know via DM on Twitter or via email at [email protected] and we will address it as soon as possible.
Thank you to all the people who have contributed to the project: Source code Contributors
Please visit our Contribution document to start contributing to our project.