event-driven

  • An event payload that grew to 4MB before causing consumer timeouts

    An OrderCompletedEvent originally carried an order ID. Over three years, developers added user profiles, order items, invoice receipts, and audit histories directly into the event payload. Fat event…

  • Testing asynchronous events with an in-memory bus spy

    Testing that domain events are published should not require spinning up RabbitMQ containers in unit test suites or mocking complex message transport interfaces. An in-memory spy replaces dozens…

  • The command bus we removed

    A command bus introduced in 2021, and 88 commands with one handler each. A stack trace with four frames of dispatch before the work.

  • Message versioning, and the field added five years ago

    An additive-only message policy, and an optional field from 2021 that every consumer now requires. An optional field that everybody depends on is a required field with no…

  • An event with no consumer, published for the last time

    An event dispatched on every order since 2021, subscribed to by a module that no longer exists. The monthly report had been correct since the module was discontinued…

  • An outbox relay on two hosts, and the partition key

    A second host, and a relay that must not run twice against the same rows. The modulo on a hash of the aggregate identifier preserves per-aggregate ordering while…

  • A consumer that was deleted with its module

    A queue consumer removed along with the module it belonged to, and the queue that kept receiving messages. A TTL on a queue turns an unconsumed backlog into…

  • The read model that finally earned its place

    A projection deleted in 2023 for being premature, rebuilt in 2025 because the query is now eleven seconds.

  • A consumer that had to be idempotent and finally was

    A handler documented as idempotent since 2022, which was not, and a redelivery that proved it. A docblock claiming idempotency is a claim and not a mechanism, and…

  • A domain event with a field that was presentation

    An OrderPlaced event carrying a formatted currency string, which is a decision about a locale baked into a permanent record. The formatted string was convenient for the one…