Skip to content

Restore and propagate scoped tenant headers #264

Closed

Description

@thomhurst

Implement the tenant scope and wire-header portion of #38, independently of database selection.

Scope:

  • Add an explicitly registered scoped tenant context that preserves native UTF-8 header values without decoding.
  • Restore the tenant before resolving handler dependencies or database transaction middleware on each single-message attempt.
  • Propagate the current tenant on normal sends, direct sends, outbox payloads, and replies using the existing native header bindings.
  • Keep concurrent deliveries, retries, and pooled state isolated. Reject unsupported shared-scope batch consumption explicitly.
  • Document that incoming tenant headers require application authorization; they are not authentication.

Acceptance criteria:

  • Tests cover incoming UTF-8 headers, scope isolation, retry restoration, outgoing headers, replies, outbox payloads, and explicit conflicting overrides.
  • BenchmarkDotNet coverage measures opted-in send/receive cost and allocations.
  • Update the website with the real API and remaining planned store selection/dispatch work.

Owns core tenant scope, send/consume pipeline integration, tests, benchmarks, and tenant documentation. Database resolution, tenant_id column population, and dispatcher budgets remain separate children of #38.

Activity

  1. added
    phase-2: outbox
    area: outbox
    P3
    on Nov 2, 2026
  2. added
    in-progress
    on Nov 2, 2026
  3. thomhurst commented on Nov 2, 2026

    @thomhurst
    OwnerAuthor

    PR #269 delivers tenant scope/header propagation and retains Closes #264. Its current head is 3254211036be9f6570e778dd96dca9b3e93a77eb; it has completed draft review, is ready with auto-merge armed, and ready CI run 41495590484 is queued/running. This is a workflow wait, not an external hold. The PR owner already requested fresh reviews and promoted this head; no duplicate request or workflow rerun was made here.

    The earlier completed ready CI run 41493162771 passed 1,221/1,222 tests and failed only Kafka_passes(Reconnect) with receive-completion timeout and native No brokers available during shutdown. This matches #154. Fresh checks still show all three NuGet indexes ending at Dekaf 1.25.0 and the latest GitHub release v1.25.0; merged Dekaf#4041 remains unpublished. That upstream condition has not cleared, so its native prerequisite remains. A passing unrelated run would not prove native recovery corrected.

    The rebase preserves both MessagePack and tenant AOT smoke calls. Build, 9 focused tenancy tests and documentation build passed as recorded in the PR. Main still lacks tenant scope/header propagation and this issue is not superseded. #38 retains automatic store binding and durable tenant metadata work; #265 is being narrowed to native scoped selection that can ship independently, without copying this PR or using a fallback tenant during composition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3area: outboxin-progressphase-2: outbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions