EventTower 1.0.0
dotnet add package EventTower --version 1.0.0
NuGet\Install-Package EventTower -Version 1.0.0
<PackageReference Include="EventTower" Version="1.0.0" />
<PackageVersion Include="EventTower" Version="1.0.0" />
<PackageReference Include="EventTower" />
paket add EventTower --version 1.0.0
#r "nuget: EventTower, 1.0.0"
#:package EventTower@1.0.0
#addin nuget:?package=EventTower&version=1.0.0
#tool nuget:?package=EventTower&version=1.0.0
ServiceTower
A service bus implementation created with RabbitMQ.
Give a star
If you like this repository or you've learned something please give a star ⭐Thanks!
How ServiceTower works
ServiceTower uses a RabbitMQ.Client to establish a connection to given RabbitMQ server. Uses a abstraction layer called 'RabbitMQAdapter' to publishing/subscribing logic. For more information take a look my blog post.
Installation
.NET Core CLI
dotnet add package ServiceTower
NuGet package manager
Install-Package ServiceTower
Usage
Setting up an endpoint
Create a messaging enpoint and call Start() method.
var endpoint = Endpoint.Create("sender");
endpoint.Start()
Sending commands
Create a command class implements ServiceTower.ICommand interface and use Send() method to send the command to the destination endpoint.
var command = new CreateOrderCommand();
endpoint.Send(command, "destinationEndpoint");
Publishing events
Create an event class implements ServiceTower.IEvent interface and Use Publish() method to publish the event to all destinations.
var @event = new CustomerEmailChanged();
endpoint.Publish(@event);
Handling Commands/Events
Create a handler class that implements IMessageHandler<T> interface. The generic parameter must be ICommand or IEvent. A sample event handler shown below. Commands are handles in the same way.
public class EventHandler :
IMessageHandler<CustomerEmailChanged>
{
public Task Handle(CustomerEmailChanged message)
{
Console.WriteLine("An CustomerEmailChanged event received. Content: {0}", JsonConvert.SerializeObject(message));
return Task.CompletedTask;
}
}
Runtime Demo
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- EventTower.Messages (>= 1.0.0)
- NewtonSoft.json (>= 12.0.3)
- Polly (>= 7.2.1)
- RabbitMQ.Client (>= 6.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 616 | 11/3/2020 |