Tolitech.Messaging.IntegrationEvents
1.0.0-preview.3
dotnet add package Tolitech.Messaging.IntegrationEvents --version 1.0.0-preview.3
NuGet\Install-Package Tolitech.Messaging.IntegrationEvents -Version 1.0.0-preview.3
<PackageReference Include="Tolitech.Messaging.IntegrationEvents" Version="1.0.0-preview.3" />
<PackageVersion Include="Tolitech.Messaging.IntegrationEvents" Version="1.0.0-preview.3" />
<PackageReference Include="Tolitech.Messaging.IntegrationEvents" />
paket add Tolitech.Messaging.IntegrationEvents --version 1.0.0-preview.3
#r "nuget: Tolitech.Messaging.IntegrationEvents, 1.0.0-preview.3"
#:package Tolitech.Messaging.IntegrationEvents@1.0.0-preview.3
#addin nuget:?package=Tolitech.Messaging.IntegrationEvents&version=1.0.0-preview.3&prerelease
#tool nuget:?package=Tolitech.Messaging.IntegrationEvents&version=1.0.0-preview.3&prerelease
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 | Versions 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. |
-
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 |