Skip to main content

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>, and IPipelineStreamBehavior<TMessage, TResponse>.
  • Retry, timeout, and circuit-breaker strategies for notification/request handlers via NetMediate.Resilience.
  • Source generator support (NetMediate.SourceGeneration) — generates AddNetMediate() with fully AOT-safe closed-type Register*Handler<> calls at compile time.
  • OpenTelemetry traces and metrics for Send/Request/Notify/RequestStream via built-in ActivitySource/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, no typeof(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.Moq helper 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 handler Handle methods return Task or Task<TResponse>.
  • Dedicated NotificationPipelineExecutor<TMessage> — resolves both IPipelineBehavior<TMessage, Task> and IPipelineBehavior<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/NetMediate in CI so no internal path goes untested.
  • BenchmarkDotNet suite — dedicated NetMediate.Benchmarks console project with CoreDispatchBenchmarks covering 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 command scenario drops more than 5 % from the previous commit baseline.

Medium term

  • Synchronous fire-and-forget notifier — optional INotifiable implementation that dispatches notification handlers inline (no Channel<T> + BackgroundService overhead) 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 one ICommandHandler<T> is registered, invoke it directly without the foreach loop.
  • IPipelineNotificationBehavior<TMessage> shorthand — a dedicated interface mirroring IPipelineRequestBehavior<,> so notification-specific behaviors have a symmetric registration experience.
  • Structured error context — surface handler exceptions through a typed MediatorException carrying the originating message type, handler type, and activity trace ID.

Long term

  • NetMediate.Diagnostics packageNetMediateDiagnostics (ActivitySource/Meter) extracted from the core assembly into NetMediate.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 single IAsyncEnumerable<TResp>, analogous to how Send fans 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 with Send(key, message), Request(key, ...), Notify(key, ...), or RequestStream(key, ...). Non-keyed registration and dispatch (using null key) continues to work as before.
  • Activity-link propagationNetMediateDiagnostics.StartActivity<TMessage> now adds an ActivityLink to the ambient Activity.Current at dispatch time, ensuring distributed traces are correctly connected across async boundaries (especially important for fire-and-forget notifications).