How to Propagate TraceId with Spring MDC Across HTTP, MQ, Thread Pools, and Jobs
This guide explains how to use Spring's built‑in Mapped Diagnostic Context (MDC) to generate a traceId for each request, configure Logback to include it in logs, and propagate the traceId through HTTP filters, RabbitMQ messages, thread‑pool tasks, and XXL‑Job scheduled jobs, complete with code examples and configuration snippets.
