Implements domain events queue processing and eventual consistency

This commit is contained in:
BinaryAlley committed 2025-01-04 17:42:40 +02:00
1 parent f96cfa4a2f
commit 80e2ce0f82
10 files changed
+198 -9

No files matched your search

+4
View File
@@ -8,6 +8,7 @@ using Lumina.Domain.Common.DependencyInjection;
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
using Lumina.Infrastructure.Common.DependencyInjection;
using Lumina.Presentation.Api.Common.DependencyInjection;
using Lumina.Presentation.Api.Common.Middlewares;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
@@ -122,6 +123,9 @@ public class Program
.WithDotNetFlag(true);
});
// add the middleware that fires domain events and ensures eventual transactional consistency
app.UseMiddleware<EventualConsistencyMiddleware>();
// create a directory relative to the application's startup directory, and use it to store static files that are served at the /media route on the API
string mediaRootDirectoryPathSetting = app.Configuration.GetValue<string>("MediaSettings:RootDirectory") ?? string.Empty;
string mediaRootPath = Path.Combine(AppContext.BaseDirectory, mediaRootDirectoryPathSetting);