SHAKA.MessageBus.IntegrationEventLog.EF 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SHAKA.MessageBus.IntegrationEventLog.EF --version 1.0.0
                    
NuGet\Install-Package SHAKA.MessageBus.IntegrationEventLog.EF -Version 1.0.0
                    
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="SHAKA.MessageBus.IntegrationEventLog.EF" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SHAKA.MessageBus.IntegrationEventLog.EF" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SHAKA.MessageBus.IntegrationEventLog.EF" />
                    
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 SHAKA.MessageBus.IntegrationEventLog.EF --version 1.0.0
                    
#r "nuget: SHAKA.MessageBus.IntegrationEventLog.EF, 1.0.0"
                    
#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 SHAKA.MessageBus.IntegrationEventLog.EF@1.0.0
                    
#: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=SHAKA.MessageBus.IntegrationEventLog.EF&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SHAKA.MessageBus.IntegrationEventLog.EF&version=1.0.0
                    
Install as a Cake Tool

SHAKA.MessageBus.IntegrationEventLog.EF

This project provides an EF Core-based implementation of SHAKA.MessageBus.IntegrationEventLog, designed for seamless database interactions in an Event-Driven System.

Overview

EF Core Model Implementations

The package includes EF Core implementations for the following SHAKA.MessageBus.IntegrationEventLog models:

  • IIntegrationEventLog
  • IFailedMessageChain
  • IFailedMessage

Each model is configured using EF Core data annotations to ensure proper schema mapping.

Service Implementations

IntegrationEventLogService

This service is responsible for managing IntegrationEventLog operations, including:

  • SaveEvent() – Converts an IntegrationEvent into an IIntegrationEventLog and persists it in the database.
  • AddInFailedMessageChain() – Creates a chain for failed messages belonging to the same entity and appends new failures if the chain already exists. The method extracts exception details to generate FailedMessage entries.
  • State Management Methods:
    • MarkEventAsPublished()
    • MarkEventAsInProgress()
    • MarkEventAsFailed()

IntegrationEventService

This service handles IntegrationEvent operations and interacts with IIntegrationEventLogService to manage event persistence. It provides:

  • GetPendingEvents(batchSize) – Loads pending IntegrationEvents for publishing in batches.
  • RetrieveFailedEventsToRepublish(chainBatchSize) – Identifies failed message chains marked with ShouldRepublish, loads their failed messages, converts them back into events for republishing, and removes the processed chains and messages.
  • Add, Update, and Remove methods – These ensure atomic database writes using the Unit of Work pattern with a default resilience strategy.

EF Core Configuration & Dependency Injection

To facilitate EF Core entity relations and service registration, this package provides the EfCoreIntegrationLogExtensions class, which includes three key extension methods:

UseIntegrationEventLogs()

Configures EF Core entity relations using the Fluent API.

ConfigureEventLogServices()

Registers essential services in the DI Container, including:

  • IIntegrationEventLogService
  • IntegrationEventService
  • Logging services
  • A generic EF Core database context, allowing consumers to inject their own DbContext implementation.

ConfigureEFCoreEventLogServicesWithPublisher()

In addition to configuring services, this method also registers the Background Service publisher.

Usage Scenarios

This package supports two approaches for integrating event publishing and handling logic:

  1. Single .NET Application Approach: The same application handles both publishing and processing of events. Use ConfigureEventLogServicesWithPublisher() to set up the publisher and handlers within the same project.
  2. Distributed Approach: The publisher and event handlers exist in separate applications. Use ConfigureEventLogServices() in the publisher app to log events, while another service handles publishing and processing.

This implementation enhances event consistency, failure recovery, and transaction reliability in an event-driven microservices architecture.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1 101 4/26/2025
1.0.0 486 3/26/2025