Class WolverineNpgsqlExtensions
Namespace: Momentum.ServiceDefaults.Messaging.Wolverine
Assembly: Momentum.ServiceDefaults.dll
[ExcludeFromCodeCoverage]
public class WolverineNpgsqlExtensions : IConfigureOptions<WolverineOptions>Inheritance
object ← WolverineNpgsqlExtensions
Implements
IConfigureOptions<WolverineOptions>
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
WolverineNpgsqlExtensions(IServiceProvider, IConfiguration, IOptions<ServiceBusOptions>)
public WolverineNpgsqlExtensions(IServiceProvider serviceProvider, IConfiguration configuration, IOptions<ServiceBusOptions> serviceBusOptions)Parameters
serviceProvider IServiceProvider
configuration IConfiguration
serviceBusOptions IOptions<ServiceBusOptions>
Methods
Configure(WolverineOptions)
Configures PostgreSQL for message persistence and transport.
public void Configure(WolverineOptions options)Parameters
options WolverineOptions
The Wolverine options to configure.
Remarks
This method:
- Sets up PostgreSQL for both persistence and transport
- Creates a persistence schema named "svcbus_{service-name}" (inbox/outbox/dead letters)
- Enables auto-provisioning of database objects
- Uses "svcbus_queues" as the transport schema
The service-name part is derived by replacing dots and hyphens with underscores and converting to lowercase. The "svcbus_" prefix keeps Wolverine's schemas clearly distinguishable from application schemas in the shared database.
Persistence reuses the application's registered (the same one TransactionalOutboxMiddleware opens its transaction on), so the outbox tables always live in the application database. This makes the atomic business-write + outbox commit structural rather than configuration-dependent: there is no separate "ServiceBus" connection string that could be pointed at a different database and silently break the outbox. When no application data source is registered (standalone library use), it falls back to the ServiceBus connection string.