Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Notifications
Notification bus implementation for Eltheon. It publishes operational notifications to registered sinks and exposes the neutral IEltheonNotificationPublisher port from Core.Abstractions.
This package no longer depends on SignalR, Metrik, or Events. Realtime delivery, metrics, and lifecycle events are optional integrations through Core.Abstractions ports.
Install
dotnet add package Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Notifications
Building Blocks
NotificationMessagedescribes the internal notification payload.NotificationScope,NotificationSeverity, andNotificationCategoryKeysremain feature-local compatibility types.INotificationPublisheris the feature-local publisher contract.IEltheonNotificationPublisheris the neutral cross-feature publisher contract from Core.Abstractions.NotificationBusfans each message out to all registeredINotificationSinkinstances.RealtimeNotificationSinkforwards notifications toIEltheonRealtimeNotificationPublisherwhen a realtime transport package, such as SignalR, provides one.
DI Setup
builder.Services.AddEltheonNotifications();
To add realtime delivery through SignalR, register the SignalR package's publisher and then add the notification bridge:
builder.Services.AddSignalRRealtimeNotificationPublisher();
builder.Services.AddNotificationSignalRBridge();
AddNotificationSignalRBridge() no longer references SignalR directly. It registers a sink that depends on IEltheonRealtimeNotificationPublisher; SignalR is only one possible implementation of that port.
Publishing
Feature code should prefer the neutral publisher when it does not need notification implementation details:
public sealed class DeploymentService
{
private readonly IEltheonNotificationPublisher _publisher;
public DeploymentService(IEltheonNotificationPublisher publisher)
{
_publisher = publisher;
}
public Task NotifyDeploymentAsync(CancellationToken ct)
{
return _publisher.PublishAsync(
title: "Deployment",
message: "A new build is live.",
scope: EltheonNotificationScope.Admin | EltheonNotificationScope.User,
severity: EltheonNotificationSeverity.Success,
category: EltheonNotificationCategoryKeys.General,
cancellationToken: ct);
}
}
Consumers inside the Notifications feature can still use INotificationPublisher and NotificationMessage directly.
Events
NotificationBus can publish lifecycle events when an IEventBus is available in DI:
Eltheon.Notifications.NotificationPublishedEltheon.Notifications.NotificationFailed
AddEltheonNotifications() registers notification event metadata but does not register the concrete EventBus. The host must add the Events package if lifecycle event publication is desired.
Events are enabled by default and can be disabled:
builder.Services.Configure<NotificationEventOptions>(options =>
{
options.EnableEvents = false;
});
The EventBus-to-notification bridge remains opt-in through NotificationEventOptions.EnableEventBridge.
Metrics
If an IMetrics implementation is registered, publish attempts are counted with:
eltheon_notifications_publish_total{sink,scope,severity,success}
If no metrics implementation exists, notification delivery continues without a metrics dependency.
Notes
- Register custom sinks by implementing
INotificationSink. - Notification title and body are not copied into lifecycle events.
- Realtime delivery is a bridge, not a package dependency. Hosts choose the concrete transport.