Giter Club home page Giter Club logo

litebus's Introduction



LiteBus

An easy-to-use and ambitious in-process mediator to implement CQS

CI/CD Badge Code Coverage Badge LiteBus Nuget Version

For a detailed understanding and advanced use cases, please refer to the Wiki.

Features

  • Developed with .NET 8.0
  • Independent (No external dependencies)
  • Reduced use of reflection
  • Provides polymorphic dispatch and handling of messages with support for covariance and contravariance
  • Core Messaging Types include:
    • ICommand: Command without result
    • ICommand<TResult>: Command with a result
    • IQuery<TResult>: Query
    • IStreamQuery<TResult>: Query yielding IAsyncEnumerable<TResult>
    • IEvent: Event
  • Designed for flexibility and extensibility
  • Modular architecture: Abstractions and implementations are provided in distinct packages
  • Allows ordering of handlers
  • Can handle plain messages (class types without specific interface implementations)
  • Supports generic messages
  • Features both global and individual pre and post handlers. These handlers also support covariance and contravariance
  • Events do not necessarily need to inherit from IEvent, accommodating DDD scenarios. This is beneficial for maintaining clean domain events without binding them to any particular library interface.

litebus's People

Contributors

amirhosseinfazlikhani avatar dependabot[bot] avatar litenova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

litebus's Issues

services.AddLiteBus throws System.TypeLoadException

Exception Unhandled:
System.TypeLoadException: 'Could not load type 'LiteBus.Messaging.Abstractions.IPostHandlerHook" from assembly 'LiteBus.Messaging.Abstractions, Version=0.8.1.0, Culture=neutral, PublicKeyToken=null'.'

I have an MVC Core web app, .NET 5.0.

Inside of ConfigureServices, I make a call to services.AddLiteBus((builder) => builder.Register(typeof(MyDbContext).Assembly) which is in a separate project references by the web app.

I am following the instructions from the readme for Litebus for handler registration.

Both LiteBus and LiteBus.Extensions.MicrosoftDependencyInjection package have been imported into both projects.

Add Contextual Scenario

HandlerScenarioAttribute, alternatively named ContextAttribute, allows developers to tag handler classes with a specific operational context.

[HandlerScenario("ServiceBus")]
public class CreateUserCommandValidator : ICommandPreHandler<CreateUserCommand>
{
    // Handler implementation for service bus-specific logic
    // In this example, we could assume there is no need for any type of authorization in validator as the command is coming from backend-to-backend communication
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.