NuGet ยท nuget

Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Notifications

Provides a generic notification bus for Eltheon hosts and plugins.

Install

Install-Kommandos

dotnet add package Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Notifications --version 0.9.3.1
<PackageReference Include="Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Notifications" Version="0.9.3.1" />
paket add Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Notifications --version 0.9.3.1
Install-Package Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Notifications -Version 0.9.3.1

README

Vorschau

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

  • NotificationMessage describes the internal notification payload.
  • NotificationScope, NotificationSeverity, and NotificationCategoryKeys remain feature-local compatibility types.
  • INotificationPublisher is the feature-local publisher contract.
  • IEltheonNotificationPublisher is the neutral cross-feature publisher contract from Core.Abstractions.
  • NotificationBus fans each message out to all registered INotificationSink instances.
  • RealtimeNotificationSink forwards notifications to IEltheonRealtimeNotificationPublisher when 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.NotificationPublished
  • Eltheon.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.