[slf4j-user] Would MDC mess up when used with Java Thread Pool Executor

kumar saurabh sabs.blitz at gmail.com
Thu Sep 27 12:48:17 CEST 2018


Hi,

I am working on microservices stack and using correlation id (Unique
request id) generated via nginx to log into each microservice logs. I am
using MDC for extracting this from request header in OncePerRequestFilter
in java.

One of the microservice then use java thread executor framework and then
call other microservices.

Can using MDC with executor (java thread pool) mess up due to thread re
use? Is it possible that I get either empty MDC context or incorrect
context due to thread reuse?

I am referring below link where one such scenario is explained:
http://ashtonkemerling.com/blog/2017/09/01/mdc-and-threadpools/

A response is appreciated! Thanks

-- 
Regards,
Kumar Saurabh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20180927/f0f61b42/attachment.html>


More information about the slf4j-user mailing list