API reference

fast-twitch.middlewares.request-id

Complete generated reference for fast-twitch.middlewares.request-id

Usage and execution boundary

Associates request-id, preserving an incoming configured header when present, then propagates it to a response unless disabled or already supplied.

(ns application.middleware
  (:require [fast-twitch.middlewares.request-id :as middleware]))

(defn handler [_]
  {:status 200 :headers {"content-type" "text/plain"} :body "Hello"})

(def app (middleware/wrap-request-id handler))

This defines the Ring handler portion. Adapt app through routing/ft-handler or pass it to server/listen!; startup instructions and a complete walkthrough show the surrounding project.

Settings and defaults

Setting Meaning
:header-name Default X-Request-ID
:generator Zero-argument function; default sortable ULID generator
:response-header? Default enabled; false disables propagation

Wrapper order and all middleware families. The function reference below preserves the upstream signatures and source links; helper functions do not all share the wrapper's arity.

Upstream function reference

Generates and propagates request IDs for request correlation.

default-header-name

The default request header used to read and write request IDs. Source

generate-request-id

(generate-request-id)

Function.

Generates a sortable request ID using @std/ulid. Source

monotonic-ulid

The @std/ulid monotonic ULID generator used for default request IDs. Source

request-id-request

(request-id-request request)
(request-id-request request options)

Function.

Associates a request ID with the request, preserving an incoming ID when present. Source

request-id-response

(request-id-response response request)
(request-id-response response request options)

Function.

Adds the request ID to the response headers when configured to do so. Source

wrap-request-id

(wrap-request-id handler)
(wrap-request-id handler options)

Function.

Wraps a handler with request ID generation and response header propagation. Source


Source revision a4eb73f96836d034c7a24fe09dc7d51e4c581f64

Built with Fast-Twitch · Integrant · Datastar

Search documentation

Search pages and API symbols

Start hereWelcome to Fast-TwitchRing HTTP applications and configured native clients and transports in ClojureScript.Start hereGetting startedCompile and run your first Fast-Twitch server.Core conceptsRequest & responseUnderstand the maps at the center of a Fast-Twitch application.Core conceptsRoutingMatch URL patterns and compose handlers.Core conceptsMiddlewareWrap handlers with focused request and response behavior.GuidesHTML & IntegrantCompose a UI system with Integrant and render Hiccup.