Coder Social home page Coder Social logo

eventbus's Introduction

Rabble EventBus

logo

A library make you publish and subscribe event easier in ditributed microservice,serverless or any architecture.

Note for Pull Requests (PRs):We accept pull request from the community. When doing it, please do it onto the DEV branch which is the consolidated work-in-progress branch. Do not request it onto Master branch, if possible.

Installing EventBus by using RabbitMQ

Install-Package Rabble.EventBus.RabbitMQ

Usage

ASP.NET Core

public void Configure(IServiceCollection services)
{
     services.AddRabbitMQEventBus(opt =>
            {

                opt.Host = "ha-proxy-host-for connect RabbitMQ";
                opt.QueueName = "Current Application Name";
            });
}

public void Configure(IApplicationBuilder app,IEventBus ebs)
{
    ebs.Subscribe<MyIntegrationEvent,MyIntegrationEventHandler>();
}

ASP.NET or .NET Framework

EventbusFactory.Initialize(opt=>{
		opt.Host = "ha-proxy-host-for connect RabbitMQ";
        opt.QueueName = "Current Application Name";
});

EventbusFactory.GetRequiredService<IEventBus>();

Architecture overview

When you call EventBus.Publish(Event) , a new message will be publish to a RabbitMQ exchange named 'ha_rabble_event_bus' and event with routingKey 'event.GetType().Name',you can configure the exchange name:

public void Configure(IServiceCollection services)
{
     services.AddRabbitMQEventBus(opt =>
            {
                opt.BrokerName='your-exchange-name'
            });
}

exchange type is direct and Queue(Same Type Microservice Application) will bind routing key event.GetType().Name when you called EventBus.Subscribe(),and Queue will unbind routing key when called EventBus.UnSubscribe.

Throws exception when handler error,and will retry automatic in 1 seconds.

Still drawing the architecture diagram........

eventbus's People

Contributors

wu-yafeng avatar dependabot-preview[bot] avatar

Stargazers

NewLiu avatar

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.