Five middleware on the command bus, of which two had a code path and three did not.
transaction used. moved to the two services
that needed it.
authorisation used once, on one command. moved to
the controller.
logging registered, and configured to log at
debug, into a channel discarding
debug. no output since 2022.
retry registered, and every command it
could retry is dispatched
synchronously from an HTTP request.
it has never retried anything.
metrics emitted a counter nobody had a
dashboard for.
Three of five doing nothing is the argument for removing the bus rather than for removing three middleware, because the machinery exists to support exactly this kind of composition and two concerns do not justify it. Each of the three had been registered once and never revisited, which is what a plugin architecture invites.