WolverineInstaller
Key: Wolverine
Default Enabled: ✅ (when added via AddCritterStack())
Package: SaveApis.Utils.CritterStack
Purpose
Configures Wolverine as the message bus with PostgreSQL-backed durable messaging, structured logging, and two built-in message queues for local and cross-service communication.
What It Does
Builder phase:
- Calls
builder.Services.AddWolverine(options => { ... })with:- Auto-build message storage on startup (
AutoCreate.All) - Message start, execution, and success logged at
Information - System.Text.Json serialization with enums as strings
- Routing rules (see Message Routing below)
- Local queue
messagesdefined - PostgreSQL queue
messagesdefined and listened to
- Auto-build message storage on startup (
- Registers
WolverineOpenTelemetry meter source - Registers
WolverineOpenTelemetry trace source
Dependencies
No explicit installer dependencies. Must be registered after CritterStackInstaller (guaranteed by AddCritterStack() registration order).
Configuration
This installer has no configuration section. All settings are applied as fixed defaults.
The PostgreSQL connection used by Wolverine for its message store is provided via Marten’s IntegrateWithWolverine() call (configured in MartenInstaller). No separate connection string is needed.
Message Routing
Two marker interfaces control where messages are routed:
ILocaleMessage
Messages implementing ILocaleMessage are published to the local in-process queue named messages.
// Marker interface
public interface ILocaleMessage { }
// Usage
public record UserCreatedEvent(Guid UserId, string Email) : ILocaleMessage;
// Publish (via Wolverine IMessageBus)
await bus.PublishAsync(new UserCreatedEvent(userId, email));
Use for: events or commands that should be handled within the same process. No durable persistence — if the process crashes, unprocessed messages are lost.
IServiceMessage
Messages implementing IServiceMessage are published to the PostgreSQL-backed durable queue named messages.
// Marker interface
public interface IServiceMessage { }
// Usage
public record SendEmailCommand(Guid RecipientId, string Subject) : IServiceMessage;
// Publish
await bus.PublishAsync(new SendEmailCommand(recipientId, subject));
Use for: commands or events that must survive process restarts or be consumed by another service. Backed by the PostgreSQL outbox table provided by MartenInstaller.
OpenTelemetry Integration
The installer registers Wolverine as an OTLP source automatically:
builder.Services.ConfigureOpenTelemetryMeterProvider(meter => meter.AddMeter("Wolverine"));
builder.Services.ConfigureOpenTelemetryTracerProvider(trace => trace.AddSource("Wolverine"));
This happens in AddCritterStack() (before the installer runs), so Wolverine metrics and traces are exported via the application’s configured OTLP endpoint when OpenTelemetryInstaller is active.
Similarly, Marten sources are also registered:
metrics.AddMeter("Marten").AddMeter("Wolverine")
traces.AddSource("Marten").AddSource("Wolverine*")
Notes
- Both
ILocaleMessageandIServiceMessageroute to a queue namedmessages, but via different transports. Wolverine resolves the correct transport based on the message type at publish time. - Wolverine message handlers are discovered automatically from
context.SoftwareAssembly(configured viaCritterStackInstaller). - For saga and aggregate persistence via Wolverine + Marten, use Marten’s event store and Wolverine’s
IntegrateWithWolverine()integration (enabled byMartenInstaller).
Related
- CritterStack Overview
- CritterStackInstaller — sets JasperFx defaults
- MartenInstaller — provides the PostgreSQL connection and outbox storage