Roadmap
This roadmap consolidates improvement ideas and new features for the NetMediate ecosystem.
Completed
- Pipeline behaviors/interceptors (pre/post processing) via
IPipelineBehavior<TMessage, TResult>,IPipelineBehavior<TMessage>,IPipelineRequestBehavior<TMessage, TResponse>, andIPipelineStreamBehavior<TMessage, TResponse>. - Retry, timeout, and circuit-breaker strategies for notification/request handlers via
NetMediate.Resilience. - Source generator support (
NetMediate.SourceGeneration) — generatesAddNetMediate()with fully AOT-safe closed-typeRegister*Handler<>calls at compile time. - OpenTelemetry traces and metrics for
Send/Request/Notify/RequestStreamvia built-inActivitySource/Meter(NetMediateDiagnostics). - Benchmark suite with load and pipeline-variant tests covering commands, requests, notifications, and streams.
- NativeAOT and trimming compatibility — no
MakeGenericType, no assembly scanning, notypeof(TResult)runtime switches; closed-type executors registered per handler at startup. - Quartz.NET integration (
NetMediate.Quartz) for persistent, crash-recoverable, and cluster-distributed notification execution. - Notification adapter contracts and utilities can be implemented as user-defined pipeline behaviors that forward notifications to external queues and streams.
- DataDog integration packages (
NetMediate.DataDog.OpenTelemetry,NetMediate.DataDog.Serilog,NetMediate.DataDog.ILogger). -
NetMediate.Moqhelper package with fluent async setup extensions and mediator mock registration. - Marker-interface-free messaging — any plain class or record can be a message type.
-
Task-based handler contracts — all handlerHandlemethods returnTaskorTask<TResponse>. - Dedicated
NotificationPipelineExecutor<TMessage>— resolves bothIPipelineBehavior<TMessage, Task>andIPipelineBehavior<TMessage>without a runtime type switch, keeping the notification pipeline AOT-safe. - Sample applications (API, Worker, Minimal API) in
docs/SAMPLES.md. - Full documentation suite: installation, configuration, resilience, source generation, AOT, DataDog, Moq recipes, diagnostics, Quartz, benchmarks.
Near term
- Coverage gate — enforce 100 % line coverage for
src/NetMediatein CI so no internal path goes untested. - BenchmarkDotNet suite — dedicated
NetMediate.Benchmarksconsole project withCoreDispatchBenchmarkscovering command, notification, request, and stream;[MemoryDiagnoser]reports mean, alloc/op, gen0; supports both JIT and NativeAOT runs via-p:AotBenchmark=true. - Per-commit throughput regression gate — fail CI if the
commandscenario drops more than 5 % from the previous commit baseline.
Medium term
- Synchronous fire-and-forget notifier — optional
INotifiableimplementation that dispatches notification handlers inline (noChannel<T>+BackgroundServiceoverhead) for scenarios where latency matters more than isolation. - Pre-compiled behavior chain — build the behavior delegate chain once at startup per message type and cache it in a static generic field, eliminating the per-call
Reverse/Aggregate/closure allocation. - Single-handler fast path for
Send— when exactly oneICommandHandler<T>is registered, invoke it directly without theforeachloop. -
IPipelineNotificationBehavior<TMessage>shorthand — a dedicated interface mirroringIPipelineRequestBehavior<,>so notification-specific behaviors have a symmetric registration experience. - Structured error context — surface handler exceptions through a typed
MediatorExceptioncarrying the originating message type, handler type, and activity trace ID.
Long term
-
NetMediate.Diagnosticspackage —NetMediateDiagnostics(ActivitySource/Meter) extracted from the core assembly intoNetMediate.Diagnostics; implemented as pipeline behaviors (TelemetryNotificationBehavior,TelemetryRequestBehavior,TelemetryStreamBehavior); auto-registered by the source generator when the package is referenced (first in pipeline order). - Streaming fan-out — multiple
IStreamHandler<TMsg, TResp>registrations are supported; their items are merged sequentially into a singleIAsyncEnumerable<TResp>, analogous to howSendfans out to multiple command handlers. - Keyed handler registration — runtime routing via service keys. Handlers can be registered with an optional key (
RegisterCommandHandler<THandler, TMsg>("routingKey")) and dispatched withSend(key, message),Request(key, ...),Notify(key, ...), orRequestStream(key, ...). Non-keyed registration and dispatch (usingnullkey) continues to work as before. - Activity-link propagation —
NetMediateDiagnostics.StartActivity<TMessage>now adds anActivityLinkto the ambientActivity.Currentat dispatch time, ensuring distributed traces are correctly connected across async boundaries (especially important for fire-and-forget notifications).