[ https://issues.apache.org/jira/browse/HTTPCLIENT-2287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17747085#comment-17747085 ]
Oleg Kalnichevski commented on HTTPCLIENT-2287: ----------------------------------------------- [~patrickjamesbarry] One cannot reliably use any thread bound context detail with the async transport. It employs a relatively small number of i/o reactor thread to handle i/o events over multiple channels (or sessions). The same i/o thread can be processing multiple message exchanges at the same time. The thread ID (or any thread-local attribute) is meaningless as a correlation ID. However HttpClient generates a unique identifier for for each message exchange accessible through the HttpContext associated with the message exchange. The same ID is also used by the internal log statements as a log correlation ID. This is the only bit one can use and nothing else. Oleg > Advice needed on preserving MDC > ------------------------------- > > Key: HTTPCLIENT-2287 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2287 > Project: HttpComponents HttpClient > Issue Type: Task > Affects Versions: 5.1.4 > Reporter: Patrick Barry > Priority: Major > > I have seen other tickets around this but none provide a clear solution. > When using > CloseableHttpAsyncClient, how does one preserve MDC (Mapped Diagnostic > Context)? Or in general, what thread pools are in play when requests are > made with this client? > > Are different threads used when various components of the client are in play. > Example, Custom RetryHandler, ExecInterceptors, Request/ResponseInterceptor. > > Does the answer apply to 5.2 versions as well? > > fyi: Our client is configured to use PoolingAsyncClientConnectionManager as > well -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org