Repository navigation
Closed
6 / 66 of 6 issues completedLabels
Description
Complete multi-tenant outbox/inbox support from design §6.6 using application-owned native store configuration.
Already shipped:
- Restore and propagate scoped tenant headers #264 / Propagate scoped tenant headers through sends and consumers #269 (
99d4412): scoped tenant restoration, retries and native-header propagation. - Validate native tenant store isolation #265 / Validate native tenant store isolation #284 (
d21488b): real PostgreSQL database/schema isolation tests and documentation for explicitly selected native connections/DbContexts.
Remaining scope (native sibling deliverables #403, #404 and #405; #266 was closed as superseded):
- Support authorized incoming tenant selection of application-owned scoped connections/DbContexts without replacing native Npgsql or EF configuration. Do not add a duplicate resolver facade.
- Compose consumers without a fallback tenant:
EntityFrameworkCoreConsumerExtensionscurrently resolves TContext throughConsumePipelineBuilder.Usein a temporary startup scope before an incoming tenant exists. Resolve/validate the selected context in the authorized delivery scope. - Keep durable tenant metadata consistent with the selected store and wire header; reject mismatches before durable work. Incoming identifiers require application authorization.
- Add
ITenantSourceenumeration from an application-owned catalog of native Npgsql data sources and explicit store options. Reuse PostgreSQL direct/recovery dispatch, ordered lanes, lease coordination and cleanup per tenant store. - Enforce one bounded connection budget shared across dispatch, lease and maintenance activity; avoid an unbounded native pool or permanent worker per tenant. Preserve stored tenant headers and isolate each store's lanes/leases.
Acceptance criteria:
- Real PostgreSQL tests across several databases and schemas prove automatic selection, overlapping message IDs, rollback, concurrent scope isolation and durable tenant/header consistency.
- A regression composes a consumer with a native scoped resolver that rejects unset tenants; delivery restores and authorizes its tenant before resolving transaction/handler dependencies, including retries.
- Dispatch tests cover ordered/unordered recovery, isolated leases, cleanup, contention and bounded connections. Added/removed/failed tenant stores, cancellation and shutdown do not leak permits or block unrelated tenants.
- Inspect pinned native client facilities before building connection coordination; reuse existing Relayer dispatch and store configuration. Add performance coverage when required and update website documentation/status to the actual implemented boundary.
#266 is superseded by this parent. #403 owns scoped EF consumer composition, #404 durable tenant/store/header consistency, and #405 native catalog dispatch with a shared bounded connection budget. These are independent direct children, with no parent/one-child chain. #33 shipped in #161 and is not a blocker. The remaining work is claimable without an external gate. See docs/design.md §6.6 and docs/decisions.md.
Sub-issues
Collapse Sub-issuesSub-issues
Loading 6 sub-issues
Activity
thomhurst commentedon Nov 1, 2026
Triage against origin/main bf3191f: The outbox packages still contain options only; tenant store resolution and dispatch are not implemented. Added native blocked-by dependencies on #33, matching the prerequisites already documented in this issue. Existing scope and acceptance criteria remain current.
thomhurst commentedon Nov 2, 2026
Split the remaining work into independently mergeable native sub-issues: #264 tenant scope/header propagation, #265 tenant-aware outbox/inbox store resolution, and #266 bounded tenant dispatch. #265 depends on #264; #266 depends on #265. Implementing #264 first; this parent remains open until all acceptance criteria, including several tenant databases, are delivered.
thomhurst commentedon Nov 2, 2026
Audited all three children and their prerequisites. They are direct children of #38, with no deeper native sub-issue hierarchy to flatten. Removed the closed #33 dependency (shipped in #161). #264 already has PR #269; its older failed reconnect run matches #154, whose merged native fix still has no published package (all three NuGet indexes and GitHub releases end at 1.25.0). No unchanged CI run was retried.
Native-first inspection showed that existing scoped EF factories and PostgreSQL transaction overloads already select application-owned stores. Removed #265's stale #264 dependency, claimed the independent selection/isolation work and opened draft #284. Its real PostgreSQL tests exercise three databases and three schemas, inbox identity isolation, rollback, concurrent scopes and native data-source ownership. The PR documents the existing APIs instead of adding a duplicate resolver facade.
Also removed #266's #265 dependency: the narrowed tests/docs unit adds no production contract that dispatch must await. #266 now owns its native store catalog/source and shared dispatch/maintenance budget and is claimable immediately. Its original dispatch acceptance criteria remain.
This parent stays open. It explicitly retains dynamic tenant-to-DbContext binding (including startup composition without a fallback tenant) and durable tenant/header consistency, plus bounded dynamic dispatch. #284 does not claim complete multi-tenancy.
thomhurst commentedon Nov 10, 2026
#264/#265 are complete through merged #269/#284. Consolidated the sole remaining child #266 into this issue and closed it as superseded, preserving its native catalog, bounded dispatch/maintenance, isolation and failure acceptance criteria alongside this issue’s automatic scoped-store and durable tenant/header criteria. Main
dfa340astill has no ITenantSource/shared tenant connection budget and still resolves EF context during startup composition; those remain implementation work.thomhurst commentedon Nov 10, 2026
Audited origin/main
4e868b14cb1fcd1a6b24b1eb8bd48b71208bf33e: #264/#265 shipped in #269/#284, while #266 closed as superseded rather than implemented.EntityFrameworkCoreConsumerExtensions.Createstill resolves TContext during startup;OutboxContext.Addaccepts caller-supplied tenant metadata; PostgreSQL has no ITenantSource/shared tenant connection budget. The parent cannot close.Split the remaining independent deliverables into native sibling issues: #403 scoped EF consumer composition/validation/retries without a fallback tenant; #404 authorized store/header/durable metadata binding; #405 native tenant catalog dispatch with one shared bounded connection budget. Each preserves its real PostgreSQL, documentation and performance criteria. All are direct children of this parent, with no artificial dependency chain. Implementing #403 under its own lock; #38 remains open for the full acceptance criteria.
thomhurst commentedon Nov 10, 2026
Re-checked and claimed this parent, then audited its acceptance criteria against fresh
origin/mainbfda3d3. All six native children are closed. #266 was superseded, so its closure alone was not treated as implementation evidence; its dispatch scope shipped through #405 / #429.The parent is complete:
d21488b) plus Compose EF Core consumers with tenant-required scoped DbContexts #403 / Resolve tenant EF consumer contexts in delivery scopes #408 (14d693a).TenantStoreSelectionTestsprovisions three tenant databases or three schemas. Incoming delivery tests exercise simultaneous scopes, duplicate inbox IDs, rollback and retry; missing/unknown/unauthorized tenants never select a default store.Incoming_tenants_select_authorized_stores_without_a_startup_fallbackandIncoming_tenant_is_authorized_again_before_each_native_retry_resolves_handler_dependenciesverify composition performs no authorization and each retry reauthorizes before handler dependencies resolve.2952ecb) supplies the application-authorizedOutboxTenantBindingthrough native scoped options. The factory remains responsible for authorization and correct store selection.OutboxTenantBindingTestsandAuthorized_metadata_is_atomic_and_mismatches_poison_native_and_EF_unitscover missing/duplicate/conflicting headers, metadata, scope changes, synchronous/asynchronous native and EF commits, and rollback of rejected units.2ff21b2) implementsITenantSourceand one scheduler reusing existing direct/recovery dispatch, ordered lanes, fenced leases and cleanup.TenantDispatchTestscovers ordered/unordered recovery across databases/schemas, original headers, independent leases, retention, contention, additions/removals/replacement, failed/invalid stores, turn fairness, cancellation/shutdown and the aggregate physical connection bound. Fix PostgreSQL tenant backend shutdown observation #439 (a5388f2) additionally fixes backend-exit observation while preserving the active connection-bound assertion.Pooling=false; separate pooled business writers remain supported. Existing dispatch/store operations are reused. MemoryDiagnoser coverage exists inEntityFrameworkCoreConsumerBenchmarks,PostgreSqlEnqueueBufferBenchmarksandPostgreSqlTenantDispatchBenchmarks. The tenant store reference, design §6.6, roadmap and homepage describe the implemented boundary, including application authorization, single-message EF consumers and catalog-only connection limits.Fresh validation on the audited main commit, in an isolated worktree:
The merged implementation PRs also record solution builds, broader PostgreSQL suites, website production builds and benchmark execution coverage. This parent audit changes no source or documentation and makes no new throughput claim. No remaining parent acceptance criterion requires implementation; closing as completed.