Skip to content

Instantly share code, notes, and snippets.

@oporkka
oporkka / README.md
Last active March 8, 2018 12:43
An example of having a request-scoped stuartsierra/component with Ring middleware

Asking for comments on this approach

The idea here is to simplify how we are passing the request the metadata type header "X-Flow-Id" to web service client methods which in turn propagate it to the other microservices that they are calling for flow tracking purposes.

Instead of passing e.g. an extra request-ctx parameter to the web service client method:

  (defn entities [component entity-id request-ctx] ...)

we can include the flow-id as a stuartsierra/component dependency