Tolitech.Messaging.IntegrationEvents 1.0.0-preview.3

This is a prerelease version of Tolitech.Messaging.IntegrationEvents.
dotnet add package Tolitech.Messaging.IntegrationEvents --version 1.0.0-preview.3
                    
NuGet\Install-Package Tolitech.Messaging.IntegrationEvents -Version 1.0.0-preview.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Tolitech.Messaging.IntegrationEvents" Version="1.0.0-preview.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tolitech.Messaging.IntegrationEvents" Version="1.0.0-preview.3" />
                    
Directory.Packages.props
<PackageReference Include="Tolitech.Messaging.IntegrationEvents" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Tolitech.Messaging.IntegrationEvents --version 1.0.0-preview.3
                    
#r "nuget: Tolitech.Messaging.IntegrationEvents, 1.0.0-preview.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Tolitech.Messaging.IntegrationEvents@1.0.0-preview.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Tolitech.Messaging.IntegrationEvents&version=1.0.0-preview.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Tolitech.Messaging.IntegrationEvents&version=1.0.0-preview.3&prerelease
                    
Install as a Cake Tool

Tolitech.Messaging.IntegrationEvents

A lightweight .NET library for defining and dispatching integration events across distributed systems. It provides a simple interface for event definition and an envelope for scheduling event processing.

Overview

Tolitech.Messaging.IntegrationEvents enables decoupled communication between system components using integration events. It is designed for easy integration with messaging systems and event-driven architectures.

Features

  • IIntegrationEvent Interface: Base contract for all integration events.
  • IntegrationEventEnvelope: Encapsulates events with optional scheduling (delay or enqueue time).
  • Flexible Scheduling: Dispatch events immediately, after a delay, or at a specific time.

Installation

Add the NuGet package to your project:

dotnet add package Tolitech.Messaging.IntegrationEvents

Usage

1. Define an Integration Event

public sealed class UserCreatedEvent : IIntegrationEvent
{
    public Guid UserId { get; init; }
    public string Email { get; init; }
}

2. Create an Envelope

var integrationEvent = new UserCreatedEvent { UserId = Guid.NewGuid(), Email = "user@example.com" };

// Immediate dispatch
var envelope = IntegrationEventEnvelope.Create(integrationEvent);

// Dispatch after a delay
var delayedEnvelope = IntegrationEventEnvelope.Create(integrationEvent, TimeSpan.FromMinutes(10));

// Dispatch at a specific time
var scheduledEnvelope = IntegrationEventEnvelope.Create(integrationEvent, DateTimeOffset.UtcNow.AddHours(1));

3. Integrate with Messaging System

Use the envelope with your preferred messaging infrastructure (e.g., Azure Service Bus, RabbitMQ, Kafka) to send and process events.

API Reference

IIntegrationEvent

Base interface for all integration events:

public interface IIntegrationEvent;

IntegrationEventEnvelope

Encapsulates an event and scheduling info:

public sealed class IntegrationEventEnvelope
{
    public IIntegrationEvent IntegrationEvent { get; }
    public TimeSpan? ProcessingDelay { get; }
    public DateTimeOffset? EnqueueDate { get; }

    public static IntegrationEventEnvelope Create(IIntegrationEvent integrationEvent);
    public static IntegrationEventEnvelope Create(IIntegrationEvent integrationEvent, TimeSpan processingDelay);
    public static IntegrationEventEnvelope Create(IIntegrationEvent integrationEvent, DateTimeOffset enqueueDate);
}
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Tolitech.Messaging.IntegrationEvents:

Package Downloads
Tolitech.Application.Messaging

Application.Messaging is a lightweight library designed to simplify the implementation of event-driven architectures within .NET applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview.3 364 21 days ago