eventbus icon indicating copy to clipboard operation
eventbus copied to clipboard

A simple Event Bus abstraction layer for working with events in .NET.

Simple Multi-Transport Event Bus for .NET

NuGet Nuget GitHub Workflow Status Dependabot license

This repository contains the code for the Tingle.EventBus libraries. This project exists to simplify the amount of work required to add events to .NET projects. The existing libraries seem to have numerous complexities in setup especially when it comes to the use of framework concepts like dependency injection and options configuration. At Tingle Software, we use this for all our event-driven architecture that is based on .NET

Packages

Package Description
Tingle.EventBus Base of the event bus library to allow you to publish and consume events from different transports.
Tingle.EventBus.Serializers.NewtonsoftJson Support for serializing events using Newtonsoft.Json.
Tingle.EventBus.Transports.Amazon.Abstractions Abstractions for working with Amazon (AWS) based transports.
Tingle.EventBus.Transports.Amazon.Kinesis Transport based on Amazon Kinesis.
Tingle.EventBus.Transports.Amazon.Sqs Transport based on Amazon Simple Queue Service.
Tingle.EventBus.Transports.Azure.Abstractions Abstractions for working with Azure based transports.
Tingle.EventBus.Transports.Azure.EventHubs Transport based on Azure Event Hubs.
Tingle.EventBus.Transports.Azure.QueueStorage Transport based on Azure Storage Queues.
Tingle.EventBus.Transports.Azure.ServiceBus Transport based on Azure Service Bus.
Tingle.EventBus.Transports.InMemory Transport that works only in memory and in process, useful for testing.
Tingle.EventBus.Transports.Kafka Transport based on the open source Apache Kafka platform.
Tingle.EventBus.Transports.RabbitMQ Transport based on the open source RabbitMQ broker.

Documentation

A number of the documents below are still a work in progress and will be added as they get ready.

Getting started

Bus Concepts and Configuration

Features

  • Choosing a transport
  • Multiple transports in one bus
  • Retries
  • Event and Consumers
  • Observability
  • Your first app

How to ...

  • Use configuration
  • Work with Azure IoT Hub
  • Work with Azure Managed Identities
  • Advanced Service Bus options
  • Work with Feature Management
  • Extend event configuration

Samples

  • Using IConfiguration to configure the EventBus
  • Simple Consumer
  • Simple Publisher
  • Build a custom event serializer
  • Build a custom event configurator
  • Consume multiple events in one consumer
  • Consume same event in multiple consumers
  • Publish and consume events from multiple transports of the same type
  • Publish and consume events from multiple transports of different types
  • In memory background processing
  • Using Amazon SQS and SNS
  • Receive events from Azure IoT Hub
  • Using Azure Managed Identity instead of Connection Strings
  • Health Checks for Azure Service Bus with Managed Identity
  • Publishing AOT

Instrumentation and observability

All the libraries is instrumented using System.Diagnostics.Activity and System.Diagnostics.ActivitySource. This makes it easy to use with OpenTelemetry by listening to the Tingle.EventBus activity source.

services.AddOpenTelemetry().WithTracing().AddSource("Tingle.EventBus");

Issues & Comments

Please leave all comments, bugs, requests, and issues on the Issues page. We'll respond to your request ASAP!

License

The Library is licensed under the MIT license. Refer to the LICENSE file for more information.