Repository navigation
Wolverine 6.39.0
Two themes in this release: multi-tenancy correctness and modular monolith ergonomics, plus a health-signal fix that will quiet a lot of false alerts.
Declare a module's ancillary store once
Modular monoliths on ancillary stores had to repeat [Storage(typeof(IOrdersStore))] on every handler, endpoint and service in a module -- restating on each type a fact that belongs to the module, where missing one meant quietly committing to the wrong database.
opts.Policies.UseAncillaryStorageFromAssemblyContaining<OrdersModule>(typeof(IOrdersStore));That covers message handlers, HTTP endpoints and gRPC services in that assembly, for Marten, Polecat and Fisher alike. An explicit [Storage] on a type still wins, so one handler can opt out of its module's default.
For gRPC this is not an ergonomic win but the only thing that works: the gRPC chains never apply chain-modifying attributes, so [Storage] on a gRPC service compiles, looks right, and does nothing. (#4477)
The stuck-poller health check was mostly crying wolf
This was for CritterWatch
The scheduled-job "poller is stuck" signal counted every scheduled envelope, whether or not it was due yet. A queue holding messages that are not due is a queue doing its job -- so any deliberate delay longer than the check window reported the poller as stuck, and stayed that way. Ordinary retry scheduling has the same shape, which means the signal grew with correct usage.
Measured on a production fleet of 512 sharded message databases: 254 of 271 active alerts -- 94% -- were this one check, across 265 databases. 114 of those were "degraded" over a single envelope scheduled 15 minutes out by an application deliberately waiting for a quiet period.
PersistedCounts.ScheduledDue now counts only envelopes already past their execution time, and the health signal reads that instead. It is an int?, and null means not measured rather than zero: a store that does not report it makes the signal stand down rather than falling back to the undifferentiated count, because falling back is the defect. PostgreSQL implements it as a FILTER on the existing scan, so the due count costs no extra query; the other providers report null and are simply silent here for now. (#4476)
Tenant message stores were sharing an identity
IMessageStore.Name is a tenant routing cache key, so two tenant stores answering to the same name send one tenant's messages to the other tenant's database.
- PostgreSQL (#4468): the sticky queue listener agents resolve their database by tenant id instead of falling through to the default store.
- SQL Server (#4471): tenant message stores are named after their database.
- MySQL (#4472): tenant stores registered by data source are named, and the queue keeps its sender.
If you run multi-tenanted durable messaging on any of these three, this release is worth taking.
RabbitMQ virtual-host tenants never got publisher confirms
ConfigureChannelCreation(...) reached only the parent transport's channels. Every virtual-host tenant created its channels with PublisherConfirmationsEnabled and PublisherConfirmationTrackingEnabled false regardless, with no public way to set them per tenant.
That matters more than a missing option: without confirmation tracking, BasicPublishAsync returns before the broker can refuse the publish, so the sending agent counts it successful and deletes the envelope from the durable outbox. A refused publish -- an ACCESS_REFUSED after a vhost user loses write permission, say -- silently drops a message whose enrolling transaction has already committed.
Behaviour change worth knowing about: if you call ConfigureChannelCreation and have tenants configured, your tenant channels now get confirms and ConsumerDispatchConcurrency where they previously got neither. Publishing to tenant vhosts gets slower, correctly so.
Thanks to @outofrange-consulting for a report that arrived with a measurement table and the fix already located. (#4473)
Ancillary-only hosts picked the wrong persistence strategy
A host registering only an ancillary store through IntegrateWithWolverine<T> registered no codegen extension, so [Entity] and storage-action code silently read an empty in-memory dictionary. Fixed for Marten (#4464), Polecat (#4465) and Fisher (#4466).
Scheduled messages promoted from RavenDb and CosmosDb lost their store
Envelope.Store is in-memory only, and the inbox routes every write on it, falling back to the main store when null. Neither document store stamped it when promoting a scheduled message, so an ancillary RavenDb or CosmosDb store's rows were marked handled against the wrong store, matched nothing, and were re-promoted on every pass -- forever. Every relational store already did this; these two now match. (#4473)
Also in this release
- HTTP (#4454): a
SourceServiceFromHttpContext<T>service is declared once per HTTP chain rather than repeatedly. - Docs: unit testing an aggregate handler with
StubEventStream<T>, now documented store-agnostically rather than buried in a Marten sample (#4474); "routing a whole module at once" across the Marten, Polecat and Fisher ancillary pages and the modular monolith tutorial (#4477); corrections to the scheduled-durability page (#4461) and the batching API version badge (#4459). - Dependency: JasperFx moves to 2.73.1.
New test coverage
The RavenDb and CosmosDb message stores now answer the scheduled-promotion questions that MessageStoreCompliance skips for them, since neither is an IMessageDatabase. See #4216 for what is covered and what deliberately is not -- notably, whether a non-partitioned store should refuse to reschedule an already-Handled row remains an open design decision.