# Correlate request and response

**URL:** <https://discuss.elastic.co/t/correlate-request-and-response/121157>\
**Category:** Elasticsearch\
**Created:** [February 23, 2018, 3:52am UTC](https://discuss.elastic.co/t/correlate-request-and-response/121157 "2018-02-23T03:52:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris.franklin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris.franklin/32/28090_2.png) [@chris.franklin](https://discuss.elastic.co/u/chris.franklin)\
**Post date:** [February 23, 2018, 3:52am UTC](https://discuss.elastic.co/t/correlate-request-and-response/121157/1 "2018-02-23T03:52:51Z")

</div>

Hello,

I have a plugin that was written originally for Elasticsearch 1.x. It has been updated to run in the 2.x series with no problems. When I went to upgrade the plugin to 5.x, I hit a major stumbling block.

In the 2.x version of the plugin I was able to correlate the incoming request with the outgoing response using the `ThreadContext`. But this is no longer an option since `ThreadContext` was deprecated.

Does anyone know of a way to correlate the incoming request with its outgoing response? The closest I have been able to get to a solution is to use a queue associated with each Netty Channel, pushing on requests and popping them off as responses leave on that channel. But this doesn't have the accuracy I need in our high volume cluster.

Any help is appreciated!  
Chris Franklin

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 23, 2018, 3:53am UTC](https://discuss.elastic.co/t/correlate-request-and-response/121157/2 "2018-03-23T03:53:21Z")

</div>

Closed on March 23, 2018, 3:53am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
