Skip to content

Kafka to database: prove offsets commit only after the EF Core inbox/outbox transaction #840

Closed

Description

@thomhurst

Part of #37 (design §7, consume-transform-produce).

A Kafka consumer that uses consumer.EntityFrameworkCore<TContext>(...) writes the inbox row, business changes and outbox rows in one PostgreSQL transaction. Dekaf's partitioned runtime marks the record processed only after the receive returns Complete, which comes after that transaction commits (#795, D22). Nothing yet proves this end to end against a real broker and database, and the Kafka guide does not state the guarantee.

Acceptance criteria:

  • Real Kafka plus PostgreSQL tests with the existing EF Core inbox/outbox boundary, no second unit of work:
    • a crash before the database commit replays the record and the handler's side effects appear once;
    • a crash after the database commit but before the offset commit replays the record, the inbox skips the handler, and there are no duplicate business rows or outbox rows;
    • a failed attempt rolls back before its retry, and a handler cancelled on stop rolls back and its record is not committed.
  • The crash is a real process stop with no graceful offset commit, not a mocked commit.
  • The Kafka guide and EF Core inbox page state the guarantee and its limit (at-least-once delivery, deduplicated by the inbox), and the roadmap and status entries are updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2area: kafkaarea: outboxin-progressphase-2: outbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions