class ElastomerClient::Middleware::OpaqueId

This Faraday middleware implements the “X-Opaque-Id” request / response headers for Elasticsearch. The X-Opaque-Id header, when provided on the request header, will be returned as a header in the response. This is useful in environments which reuse connections to ensure that cross-talk does not occur between two requests.

The SecureRandom lib is used to generate a UUID string for each request. This value is used as the content for the “X-Opaque-Id” header. If the value is different between the request and the response, then an ‘ElastomerClient::Client::OpaqueIdError` is raised. In this case no response will be returned.

See [Elasticsearch “X-Opaque-Id” header](github.com/elasticsearch/elasticsearch/issues/1202) for more details.