Skip to content

Consume pipeline: middleware composition, DI scopes and handler invocation #4

Closed

Description

@thomhurst

Implement the receive side of the pipeline (design §2, §3.2).

Scope

  • Compose IConsumeMiddleware into a single ConsumeDelegate per consumer at startup.
  • Create a fresh DI scope per message (or per batch) and resolve the handler from it, so scoped services such as DbContext work.
  • A concrete, poolable MessageContext implementation that transports populate.
  • Deserialization through MessageTypeRegistry and IMessageSerializer.
  • Unknown message types are routed to the failure pipeline as permanent failures, never ignored.

Acceptance criteria

  • No per-message allocations from Relayer's own code in steady state (benchmark).
  • Tests for scope lifetime, middleware ordering and unknown types.

Depends on: #3, #1

See docs/design.md and docs/decisions.md.

Activity

  1. added
    phase-0: core
    area: core
    P0
    on Oct 31, 2026
  2. thomhurst commented on Nov 1, 2026

    @thomhurst
    OwnerAuthor

    The previous blocker is resolved: #3 merged in #64 (6d2339b). This unit claimed #4 and opened draft #68 with generated descriptor composition, middleware, fresh asynchronous DI scopes, pooled contexts, typed deserialization and explicit permanent contract failures. Build, 69 tests and a Native AOT smoke pass. Benchmark evidence and its DI allocation limitation are documented on the PR. Both required reviews are requested through the draft review lifecycle; no new blocker or on-hold label is needed.

  3. added
    in-progress
    on Nov 1, 2026
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

    P0area: corein-progressphase-0: core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions