The Framework Before the Framework
DShop.Common is the shared library nine microservices were built on - and the rough draft of a framework its authors later shipped as Convey.
In reading order.
DShop.Common is the shared library nine microservices were built on - and the rough draft of a framework its authors later shipped as Convey.
One naming class in DShop.Common decides every exchange, routing key and queue in the estate - the message topology is a string-formatting problem.
In DShop.Common a command and an event are published by identical code - the difference between them is a marker interface and a promise nothing enforces.
DShop.Common's correlation context threads request identity through every message hop - and a long positional argument list quietly transposes half its fields.
DShop.Common decides a message's fate from the type of exception a handler throws - domain failures become events, infrastructure failures get retried.
A complete broker-requeue retry implementation sits in DShop.Common's subscriber, fully written and never called - and its comment explains exactly why.
An audit of the messaging patterns DShop.Common leaves out - no outbox, no inbox, no consumed dead-letter - and how each absence became a Convey package.
DShop.Common ships its own in-process command and query dispatch - marker interfaces, a handler triple, and one dynamic double-dispatch standing in for a library.
A reusable try-catch-finally wrapper in DShop.Common awaits a null-conditional delegate - so the success path throws a NullReferenceException the failure path avoids.
DShop.Common picks client-side discovery, a router, or a static address from one word in JSON - and self-registers each service into Consul with a heartbeat lease.
DShop.Common's Consul registry tracks which service instances it has used to spread load evenly - then registers as transient, discarding that memory on nearly every request.
DShop.Common stamps a server-generated Guid into an immutable command by reflecting into its compiler-generated backing field - immutability the type system only pretends to enforce.
DShop.Common's error middleware maps every exception to HTTP 400, computes a safe message, then throws it away and serialises the raw exception text to the caller.
DShop.Common makes a stateless JWT revocable with a Redis deny-list and a per-request round-trip - plus an iat claim in milliseconds and two validators that disagree.
Each concern in DShop.Common builds a throwaway DI container just to read config - nine per service, atop three coexisting container frameworks and a vendored config parser.
A retrospective on DShop.Common - the frozen shared-contracts tombstone, a release candidate pinned forever, and a concordance of what Convey kept, renamed, and fixed.