Introduce the Email contract and MessagingServiceClient that send mail through the Application layer via MediatR, and add AddMessagingServiceClient overloads for delegate- and IConfiguration-based setup. Remove the empty client DI placeholders.
Remove MessagingServiceApplicationConfiguration and pass the LuckyPennySoft license key as a string. Program.cs now reads the value from configuration and fails fast with a clear error when it is missing.
BREAKING CHANGE: AddMessagingServiceApplication now takes a license key string.
Replace the MessagingServicePublisherConfiguration builder with plain overloads that accept either a configuration delegate or IConfiguration. Update EmailSender and the publisher integration test to the new API, and mark the static EmailSender obsolete ahead of the new client.
BREAKING CHANGE: AddMessagingServicePublisher no longer accepts a builder configuration delegate.
Rename the RabbitMQ options type to make its purpose explicit and update all consumers in the RabbitMQ, Infrastructure, Publisher, Client and test projects. Inline the connection factory registration in the DI extensions instead of the private AddDefaultServices helper.
BREAKING CHANGE: RabbitMqConfiguration is now RabbitMqConnectionConfiguration.
Removed the IServiceCollection dependency and related code from MessagingServiceApplicationConfiguration.cs. This includes the private property `Services`, the boolean field `_luckyPennySoftLicenseKeyAdded`, and the constructor that initialized `Services`. The `EnsureConfigured` method remains, but its functionality may be impacted by these changes.
Removed `AddMessagingServiceApplication` method from `DependencyInjection` class, simplifying service configuration. Updated namespaces from `DigitalData.MessagingService.Infrastructure` to `DigitalData.MessagingService.Infrastructure.DependencyInjection` for better organization. Adjusted `Program.cs` to use a lambda for setting `LuckyPennySoftLicenseKey`. Updated `using` directives in `EmailSyncWorker.cs` and `Program.cs` to reflect these changes.
Refactored `MessagingServiceApplicationConfiguration` to simplify the tracking of the LuckyPennySoft license key configuration by replacing the `_configured` tuple with a boolean. Removed email account configuration methods from this class.
Updated `MessagingServiceInfrastructureConfiguration` to introduce a new `_configured` tuple for tracking `RabbitMqConnectionFactory` and `EmailAccounts` configurations. Added methods for configuring email accounts and updated the `EnsureRabbitMqConnectionFactoryAdded` method to include email account checks.
Changed the namespace of `EmailAccountsOptions.cs` to `DigitalData.MessagingService.Infrastructure.Options`.
Modified `Program.cs` to include email account configuration in the infrastructure setup.
Added new files `DependencyInjectionExtensions.cs` and `MessagingServiceConfiguration.cs` as placeholders for future extensions, wrapped in `#if NET` directives.
Removed an `<ItemGroup>` from `DigitalData.MessagingService.Infrastructure.csproj` and updated `DigitalData.MessagingService.Client.csproj` for XML compliance.
- Update using directive to new DependencyInjection namespace
- Pass builder delegate to AddInfrastructure() calling
cfg.AddRabbitMqConnectionFactory(builder.Configuration)
Replace Action<RabbitMqConfiguration> parameter on AddMessagingServicePublisher()
with a builder to keep the publisher API consistent with the infrastructure layer.
- Add MessagingServicePublisherConfiguration exposing
AddRabbitMqConnectionFactory() with IConfiguration and Action<T> overloads
- Callers that need RabbitMQ must now call cfg.AddRabbitMqConnectionFactory(...)
inside the configure delegate instead of configuring RabbitMQ directly
Replace the IConfiguration parameter on AddInfrastructure() with a builder
that makes RabbitMQ wiring explicit and validated.
- Add MessagingServiceInfrastructureConfiguration exposing
AddRabbitMqConnectionFactory() with IConfiguration and Action<T> overloads
- EnsureRabbitMqConnectionFactoryAdded() throws at registration time if the
caller omits the wiring step
- Remove the implicit services.AddRabbitMqConnectionFactory(configuration)
call from AddInfrastructure(); callers must opt in via the builder
Replace the implicit IConfiguration-based DI registration with an explicit
builder that validates required steps at startup.
- Add MessagingServiceApplicationConfiguration with mandatory steps:
SetLuckyPennySoftLicenseKey(), ConfigureEmailAccounts() / PublishOnly()
- EnsureConfigured() throws at registration time if either step is missing,
surfacing misconfiguration before the app starts
- Keep the IConfiguration convenience overload as a thin wrapper over the
builder for backward-compatible call sites
- Move DependencyInjection.cs into a DependencyInjection/ subfolder alongside
the new configuration class
init-only properties cannot be mutated by Options configure delegates.
Switching to set allows the builder pattern to bind values post-construction.
Also narrows Accounts type from IEnumerable to List for index access.
Renamed the method in `DependencyInjection.cs` from `AddApplicationServices` to `AddMessagingServiceApplication` to better reflect its purpose related to the Messaging Service Application. Updated the corresponding method call in `Program.cs` to ensure consistency and correct service registration.
Store the commercial Mail.dll license alongside the infrastructure project. The file is not referenced by the csproj, so it is not copied to build output automatically.
Record.Exception does not observe faults from an async method. Convert the affected tests to async Task and use Record.ExceptionAsync so publish failures are actually asserted.
Await ISendingEmailPublisher.EnqueueAsync so publish failures surface to the caller instead of being lost in a fire-and-forget call.
BREAKING CHANGE: EmailSender.Send now returns Task and must be awaited. Synchronous callers that relied on exceptions being thrown directly from Send will no longer observe them.
Make the client package self-contained:
- Set IsPackable and keep project references private
- Add direct Application and Domain references needed at compile time
- Add EmbedProjectReferences target so referenced assemblies ship inside the package
- Reference System.Text.Json for .NET Framework targets
- Reference Options.ConfigurationExtensions explicitly
- Bump package version to 1.0.5
Wire the infrastructure health checks into ASP.NET Core:
- /health returns JSON via UIResponseWriter and maps Unhealthy to HTTP 503
- /health-ui renders a Razor Pages dashboard with per-check status, description, tags and duration
- Tag health checks (rabbitmq, workers, ready, live) for monitoring filters
- Link the dashboard from the Swagger description and the page layout
ConsumerInitWorker marks ConsumerInitHealthCheck as unhealthy when the consumer pool fails to start, so callers receive HTTP 503 instead of a silently degraded service.
EmailSyncWorker now reports its startup interval and the result of every sync cycle. SyncAccountAsync returns whether the account failed, letting the worker count errors per cycle and expose them through EmailSyncWorkerHealthCheck.
Introduce singleton health checks that background workers update at runtime:
- ConsumerInitHealthCheck reports whether the RabbitMQ consumer pool started
- RabbitMqConnectionHealthCheck opens a channel to verify broker reachability
- EmailSyncWorkerHealthCheck detects stalled or erroring sync cycles
Register all three in the infrastructure DI container so the API layer can wire them into the health check pipeline.
Replaced the `AsyncInitWorker` background service with the new `ConsumerInitWorker`, which introduces enhanced error handling, logging, and configurability for RabbitMQ consumer initialization.
Updated `MessagingServiceDbContext` to remove the `UseCollation` configuration for the `Username` property in the `EmailAccount` entity, ensuring compatibility with the InMemory database.
Added the `ContinueOnInitFailure` property to `RabbitMqConfiguration` to allow the application to continue running if RabbitMQ consumer initialization fails.
Cleaned up unused `using` directives in `DependencyInjection.cs` and removed the obsolete `AsyncInitWorker` class.
The `IEncryptionService` interface and its implementation,
`DataProtectionEncryptionService`, have been removed from the
codebase. These components previously provided encryption and
decryption functionality using the ASP.NET Core Data Protection API.
Additionally, the dependency injection setup for the encryption
service and the Data Protection API configuration (e.g., key
persistence and application name) have been removed from
`DependencyInjection.cs`.
Replaced `Directory.GetCurrentDirectory()` with `AppContext.BaseDirectory` in `Program.cs` to set the base path for configuration loading. This ensures configuration files are loaded relative to the application's runtime location instead of the current working directory.
Consolidated email fetching queries into a unified `ReadEmailQuery` to support multiple protocols (IMAP, IMAP OAuth2, POP3) dynamically. Removed redundant query handlers (`ReadEmailViaImapQuery`, `ReadEmailViaOAuth2Query`, `ReadEmailViaPop3Query`) and merged their functionality into `ReadEmailQueryHandler` with protocol-specific methods.
Updated `FetchEmailsQueryValidator` to validate the new query. Refactored `EmailController` to use the unified query, simplifying endpoints and consolidating functionality. Removed obsolete endpoints for POP3 and OAuth2 fetching.
Performed code cleanup, including removing redundant imports and consolidating attachment handling logic. Updated project version to `2.0.0-beta` to reflect these significant changes. Improved documentation to align with the new structure.