NowAround.SharedKernel.Events.Infrastructure 0.2.0

NowAround.SharedKernel.Events.Infrastructure

Infrastructure services for NowAround domain event dispatching and outbox-based integration event publishing.

This package provides default implementations for domain event queueing, EF Core outbox persistence, integration event registration, serialization, and background outbox dispatch.

Queued domain events capture the current X-Correlation-Id scope and W3C trace context when they are enqueued and restore both when the background dispatcher invokes MediatR handlers. Outbox messages persist that correlation ID together with optional W3C trace context so integration events can propagate the same application correlation across services.

Included

  • AddNowAroundDomainEventHandling for queued domain event dispatch with MediatR.
  • AddNowAroundOutboxIntegrationEvents<TDbContext> for outbox services backed by EF Core.
  • AddNowAroundInfrastructureEventsWithOutbox<TDbContext> for registering both domain and integration event infrastructure.
  • ApplyNowAroundOutbox for adding the outbox_messages entity mapping to a ModelBuilder.
  • Activity instrumentation for domain event enqueue/dispatch and outbox add/dispatch/publish.
  • Metrics for event throughput, dispatch failures, dispatch duration, queue depth, pending outbox messages, retries, and dead-lettered messages.

Usage

builder.Services.AddNowAroundInfrastructureEventsWithOutbox<AppDbContext>(
    builder.Configuration,
    typeof(SomeIntegrationEvent).Assembly);

Apply the outbox mapping from your DbContext:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    modelBuilder.ApplyNowAroundOutbox();
}

Configure optional settings under the Outbox section:

{
  "Outbox": {
    "PollIntervalSeconds": 1,
    "BatchSize": 100,
    "MaxRetryCount": 3
  }
}

Tracing

This package emits activities from the following sources:

  • NowAround.Events.Infrastructure
  • NowAround.Events.Infrastructure.RabbitMQ

Activity names:

  • domain_event.enqueue
  • domain_event.dispatch
  • outbox.add
  • outbox.dispatch
  • integration_event.publish

Important tags include:

  • correlation_id
  • event.type
  • event.category
  • event.version
  • messaging.system
  • messaging.operation

Register the sources through NowAround.SharedKernel.Observability:

builder.AddOpenTelemetry("catalog-api", options =>
{
    options.ActivitySources.Add("NowAround.Events.Infrastructure");
    options.ActivitySources.Add("NowAround.Events.Infrastructure.RabbitMQ");
});

Metrics

Register the event meters:

builder.AddOpenTelemetry("catalog-api", options =>
{
    options.Meters.Add("NowAround.DomainEvents");
    options.Meters.Add("NowAround.Outbox");
});

Domain event instruments:

  • nowaround.domain_event.enqueued.count
  • nowaround.domain_event.dispatched.count
  • nowaround.domain_event.failed.count
  • nowaround.domain_event.dispatch.duration
  • nowaround.domain_event.queue.depth

Outbox instruments:

  • nowaround.outbox.message.added.count
  • nowaround.outbox.message.dispatched.count
  • nowaround.outbox.message.failed.count
  • nowaround.outbox.dispatch.duration
  • nowaround.outbox.pending.count
  • nowaround.outbox.retry.count
  • nowaround.outbox.deadletter.count

Counters and histograms use event.type and status where relevant. Queue depth and pending count are observable gauges.

Showing the top 20 packages that depend on NowAround.SharedKernel.Events.Infrastructure.

Packages Downloads
NowAround.SharedKernel.Events.Infrastructure.MassTransit
MassTransit and RabbitMQ integration for NowAround shared integration event publishing.
25
NowAround.SharedKernel.Events.Infrastructure.MassTransit
MassTransit and RabbitMQ integration for NowAround shared integration event publishing.
11
NowAround.SharedKernel.Events.Infrastructure.MassTransit
MassTransit and RabbitMQ integration for NowAround shared integration event publishing.
10
NowAround.SharedKernel.Events.Infrastructure.MassTransit
MassTransit and RabbitMQ integration for NowAround shared integration event publishing.
7
NowAround.SharedKernel.Events.Infrastructure.MassTransit
MassTransit and RabbitMQ integration for NowAround shared integration event publishing.
5
NowAround.SharedKernel.Events.Infrastructure.MassTransit
MassTransit and RabbitMQ integration for NowAround shared integration event publishing.
3
NowAround.SharedKernel.Events.Infrastructure.MassTransit
MassTransit and RabbitMQ integration for NowAround shared integration event publishing.
2

Version Downloads Last updated
0.3.0 24 06/03/2026
0.2.1-ci.254 3 06/01/2026
0.2.0 11 06/01/2026
0.2.0-ci.235 5 05/30/2026
0.2.0-ci.218 7 05/26/2026
0.1.1-ci.214 2 05/23/2026
0.1.0 10 05/19/2026