EventBus application and introduction of NeoBus package

Omid Ahmadpour
3 min readAug 6, 2021

--

The first question is what is EventBus?

The answer is that EventBus is a mechanism that allows different components to communicate with each other without knowing each other.

In this way, a component can send an Event to EventBus without knowing who receives the Event or how many other components receive the Event.

In this way these components can be interconnected without being interdependent and so-called Independent.

EventBus

The question that may come to your mind is what is a Component ?

A component can be anything here, but there are often objects that can send or receive events.

And what is an Event?

Events occur within the system and can be said that there messages that are exchanged between components.

For example, let’s give an example in the store system, that for example, in the component of ordering a product after it’s cost is paid and purchased, as a result a product is reduced from the number of our products and these changes must be recorded in our component or warehouse system. This process can be in the form of sending an event that is sent by the order component and the warehouse component also receives it and the desired changes occur.

In this way, we were able to eliminate the dependency of the two components or modules, we also maintained their connection and system consistency.

Now in .Net I designed an EventBus that can send Command and Query as well as InMemory Events .

You can also send Distributed Events, so that if you have two applications on two different servers, you can still connect with EventBus and send Event.

NeoBus

If you use CQRS , this package can make your work much easier, and in fact, this EventBus is designed for projects written in CQRS format, but you can use it in other projects and systems as well.

This package is called NeoBus and you can get it from the NuGet Package .

https://www.nuget.org/packages/NeoBus/

All you have to do is launch Kafka and then install the NeoBus Nuget package according to the instructions published in the project github page.

There is also a test project that uses NeoBus and has various implementations that you can easily learn how to work with.

At the end, if you have a question or you want to add a new feature, you can register Issue in the project github page.

I would be happy if you learned something from this project or used it in your projects, give it a star.

Project GitHub Page: NeoBus GitHub

--

--

Omid Ahmadpour

Software Engineer / .NET Backend Developer / Technical Consultant / Open Source Contributor