Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor RestClientTransport to allow using other http client libraries #584

Merged
merged 5 commits into from Jun 13, 2023

Conversation

swallez
Copy link
Member

@swallez swallez commented May 25, 2023

Extract the logic related to high-level API objects (serialization, deserialization, error handling, etc) that exists in RestClientTransport to a new abstract ElasticsearchTransportBase class. This class delegates http processing to implementations of a new TransportHttpClient interface.

The goal is to allow additional implementations to be provided, such as one based on the builtin http client in JDK11+, and allow users to easily implement their own when needed. The new example-transports sub-project contains an example implementation that uses Netty.

Note that ElasticsearchTransportBase does not implement multi-node retry and cluster sniffing, which is provided by RestClient and would have to be re-implemented for other http libraries.

Fixes #550

@swallez swallez added the Category: Enhancement New feature or request label May 25, 2023
@swallez swallez marked this pull request as ready for review June 13, 2023 15:20
@swallez swallez changed the title [WIP] Extract base abstract behavior from RestClientTransport Refactor RestClientTransport to allow using other http client libraries Jun 13, 2023
@swallez swallez merged commit 4c3a13b into main Jun 13, 2023
4 of 5 checks passed
@swallez swallez deleted the refactor-transport branch June 13, 2023 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Design pattern strategy / factory / else to choose the actual http client.
1 participant