Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Abc-Arbitrage/Zebus
A lightweight Peer to Peer Service Bus
https://github.com/Abc-Arbitrage/Zebus
bus c-sharp distributed-systems peer-to-peer service-bus
Last synced: about 2 months ago
JSON representation
A lightweight Peer to Peer Service Bus
- Host: GitHub
- URL: https://github.com/Abc-Arbitrage/Zebus
- Owner: Abc-Arbitrage
- License: mit
- Created: 2014-05-13T14:02:14.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-11-30T16:48:59.000Z (about 1 year ago)
- Last Synced: 2024-07-30T15:29:26.905Z (5 months ago)
- Topics: bus, c-sharp, distributed-systems, peer-to-peer, service-bus
- Language: C#
- Homepage:
- Size: 31.9 MB
- Stars: 304
- Watchers: 49
- Forks: 61
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-csharp - Zebus - Zebus is a lightweight, highly versatile, peer-to-peer service bus, built with CQRS principles in mind. It allows applications to communicate with each other in a fast and easy manner. Most of the complexity is hidden in the library and you can focus on writing code that matters to you, not debugging messaging code. A very fundamental base for any distributed application. (Distributed Computing)
- awesome-dotnet-cn - Zebus - Zebus 是一个内部由CQRS规则构建的轻量级、高度通用、点对点的服务总线。它能够让应用间以一种快速和容易的方式进行通信,最复杂的部分被隐藏在所要使用的库中,这样你就能聚焦于代码中困扰着你的难题,而不用调试消息传递代码,对于任何分布式应用来说这是一个基础。 (分布式计算)
- awesome-dotnet - Zebus - Zebus is a lightweight, highly versatile, peer-to-peer service bus, built with CQRS principles in mind. It allows applications to communicate with each other in a fast and easy manner. Most of the complexity is hidden in the library and you can focus on writing code that matters to you, not debugging messaging code. A very fundamental base for any distributed application. (Distributed Computing)
- awesome-dot-dev - Zebus - Zebus is a lightweight, highly versatile, peer-to-peer service bus, built with CQRS principles in mind. It allows applications to communicate with each other in a fast and easy manner. Most of the complexity is hidden in the library and you can focus on writing code that matters to you, not debugging messaging code. A very fundamental base for any distributed application. (Distributed Computing)
- awsome-dotnet - Zebus - Zebus is a lightweight, highly versatile, peer-to-peer service bus, built with CQRS principles in mind. It allows applications to communicate with each other in a fast and easy manner. Most of the complexity is hidden in the library and you can focus on writing code that matters to you, not debugging messaging code. A very fundamental base for any distributed application. (Distributed Computing)
- awesome-dotnet - Zebus - Zebus is a lightweight, highly versatile, peer-to-peer service bus, built with CQRS principles in mind. It allows applications to communicate with each other in a fast and easy manner. Most of the complexity is hidden in the library and you can focus on writing code that matters to you, not debugging messaging code. A very fundamental base for any distributed application. (Distributed Computing)
README
# Zebus
[![Build](https://github.com/Abc-Arbitrage/Zebus/workflows/Build/badge.svg)](https://github.com/Abc-Arbitrage/Zebus/actions?query=workflow%3ABuild)
[![NuGet](https://img.shields.io/nuget/v/Zebus.svg?label=NuGet&logo=NuGet)](http://www.nuget.org/packages/Zebus/)
[![Gitter](https://img.shields.io/gitter/room/Abc-Arbitrage/Zebus.svg?label=Chat&logo=Gitter&color=blue)](https://gitter.im/Abc-Arbitrage/Zebus)Zebus is a lightweight peer to peer service bus, built with [CQRS](http://martinfowler.com/bliki/CQRS.html) principles in mind. It allows applications to communicate with each other in a fast and easy manner. Most of the complexity is hidden in the library and you can focus on writing code that matters to you, not debugging messaging code.
# Introduction
Zebus is **peer to peer**, so it does not depend on a broker to dispatch messages between the peers. This allows it to reach a throughput of 140k msg/s and a roundtrip latency under 500µs (have a look at the [Performance](https://github.com/Abc-Arbitrage/Zebus/wiki/Performance) page for details).
It is **resilient** thanks to the absence of a broker and an optional persistence feature that ensures that messages are not lost if a peer is down or disconnected.
It is **stable**, since we have been using it on a production environment at [ABC Arbitrage](http://www.abc-arbitrage.com/) since 2013, handling hundreds of millions of messages per day.
## Key concepts
### Peer
We call a peer any program that is connected to the bus, a peer is identified by a unique identifier called a PeerId that looks like this: `MyAmazingPeer.0` (we use this convention to identify different instances of the same service).
### Event
An event is sent by a peer to notify everyone who is interested that something happened (ex: `MyBusinessObjectWasSaved`, `AlertTriggered`...).
### Command
A command is sent to a peer asking for an action to be performed (ex: `SaveMyBusinessObjectCommand`).
### Message Handler
A class deriving from `IMessageHandler` will be scanned by the bus and will be used to handle messages of the `T` kind on reception.
### Bus
The piece of code that is the point of entry to use Zebus, the methods that you will use the most are `Publish(IEvent)` and `Send(ICommand)`.
## A quick demo
On startup, the bus will scan your assemblies for message handlers and notify the other peers that you are interested by those messages. When a peer publishes a message, it will use the Directory to know who handles it and send the message directly to the correct recipients.
### Receiver
```csharp
public class MyHandler : IMessageHandler
{
public void Handle(MyEvent myEvent)
{
Console.WriteLine(myEvent.Value);
}
}
```### Sender
```csharp
public void MethodThatSends(IBus bus)
{
bus.Publish(new MyEvent { Value = 42 });
}
```### Event description
```csharp
[ProtoContract]
public class MyEvent : IEvent
{
[ProtoMember(1)]
public int Value { get; set; }
}
```And you're set ! This is all the code you need to send an event from one machine to the other. If you want to read more about how the magic happens, have a look at the [wiki](https://github.com/Abc-Arbitrage/Zebus/wiki). Or if you want a more detailed walkthrough (what to reference, how to start the Bus...) visit the [Quick start](https://github.com/Abc-Arbitrage/Zebus/wiki/Quick-start) page.
# Release notes
We try to stick to the [semantic versioning](http://semver.org/) principles and keep the [release notes](https://github.com/Abc-Arbitrage/Zebus/blob/master/RELEASE_NOTES.md) and [directory release notes](https://github.com/Abc-Arbitrage/Zebus/blob/master/RELEASE_NOTES_DIRECTORY.md) up to date.
# Other repositories
- [Zebus.MessageDsl](https://github.com/Abc-Arbitrage/Zebus.MessageDsl) - a DSL which simplifies the writing of ProtoBuf contracts for Zebus
- [Zebus.TinyHost](https://github.com/Abc-Arbitrage/Zebus.TinyHost) - a lightweight host used to run Zebus enabled services
- [Zebus.Samples](https://github.com/Abc-Arbitrage/Zebus.Samples) - miscellaneous samples that show how to get started with Zebus# Copyright
Copyright © ABC Arbitrage Asset Management
# License
Zebus is licensed under MIT, refer to [LICENSE.md](https://github.com/Abc-Arbitrage/Zebus/blob/master/LICENSE.md) for more information.
# Tools
We use[![resharper_icon](https://raw.githubusercontent.com/wiki/Abc-Arbitrage/Zebus/content/icon_ReSharper.png)](https://www.jetbrains.com/resharper/)