advancedMultithreading & Concurrency314 of 436

What happens to MDC/request context when work moves from one thread to another?

Tests whether you know MDC is backed by a ThreadLocal, so context set on the request thread doesn't automatically appear on a worker thread -- it must be explicitly copied (or propagated via a TaskDecorator) when handing off work.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

← Back to all Core Java questions