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?
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