-
1. Re: Correlation id accross @Asynchronous EJB calls
jaikiran Jul 27, 2012 2:53 AM (in response to tarioch)What exactly do you mean by a correlation id and why do you need it? How do you plan to use such an id across multiple invocations?
-
2. Re: Correlation id accross @Asynchronous EJB calls
tarioch Jul 27, 2012 3:05 AM (in response to jaikiran)I just want to have one id to correlate log messages originating from a web request.
user a requests /foo.jsf
there is a servlet filter that intercepts all calls and generates a unique id and sets this into the MDC
logging is configured to always add this id
if there is a log statement on the web side or in an ejb that is called synchronously, this works fine
if there is an asynchronous invocation, the MDC context is lost and everything logged from in there does not have the unique id
My guess is that, when jboss gets the thread from the thread pool for the asynchronous request, there is the code missing to copy over the MDC (see http://logback.qos.ch/manual/mdc.html#managedThreads)
So I'm wondering if there is any way for me to workaround this without having to manually propagate the MDC on each asynchronous call.
Btw. I opened up a defect for the lost MDC: https://issues.jboss.org/browse/AS7-5258