Skip to content

Deprecate REST client (finally) - #22116

Merged
reta merged 1 commit into
opensearch-project:mainfrom
reta:issue-5424
Jun 12, 2026
Merged

Deprecate REST client (finally)#22116
reta merged 1 commit into
opensearch-project:mainfrom
reta:issue-5424

Conversation

@reta

@reta reta commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Description

Deprecate REST client ( RestClient). The internal HTTP client (see please #20634) has been introduced and designed for OpenSearch internal use only. The RestHighLevelClient is still going to be supported for now but migrated away from RestClient.

Related Issues

Closes #5424

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Andriy Redko <drreta@gmail.com>
@reta
reta requested a review from a team as a code owner June 11, 2026 23:58
@github-actions github-actions Bot added distributed framework enhancement Enhancement or improvement to existing feature or request Roadmap:Releases/Project Health Project-wide roadmap label v3.8.0 Issues and PRs related to version 3.8.0 labels Jun 11, 2026
@reta reta added skip-diff-analyzer Maintainer to skip code-diff-analyzer check, after reviewing issues in AI analysis. v3.8.0 Issues and PRs related to version 3.8.0 and removed enhancement Enhancement or improvement to existing feature or request distributed framework Roadmap:Releases/Project Health Project-wide roadmap label v3.8.0 Issues and PRs related to version 3.8.0 labels Jun 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ Recommended focus areas for review

Typo in deprecation message

The deprecation message contains a grammatical error: "is deprecated is going to be removed" should be "is deprecated and is going to be removed" or "is deprecated and will be removed". This typo appears in user-facing documentation that will be visible in IDE warnings and generated API docs.

* @deprecated the {@code RestClient} is deprecated is going to be removed in future releases, please consider using official
* OpenSearch Java Client or {@code RestHighLevelClient}

@github-actions

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Fix grammatical error in deprecation message

The deprecation message contains a grammatical error ("is deprecated is going to
be"). Remove the duplicate "is" to make the message grammatically correct and
professional.

client/rest/src/main/java/org/opensearch/client/RestClient.java [140-141]

-@deprecated the {@code RestClient} is deprecated is going to be removed in future releases, please consider using official
+@deprecated the {@code RestClient} is deprecated and is going to be removed in future releases, please consider using official
 OpenSearch Java Client or {@code RestHighLevelClient}
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies a grammatical error in the deprecation message where "is deprecated is going to be" should be "is deprecated and is going to be". This improves the professionalism and clarity of the documentation, though it's a minor issue that doesn't affect functionality.

Medium

@github-actions

Copy link
Copy Markdown
Contributor

✅ Gradle check result for c11e9b3: SUCCESS

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.34%. Comparing base (b32e6fa) to head (c11e9b3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #22116      +/-   ##
============================================
- Coverage     73.36%   73.34%   -0.03%     
+ Complexity    75847    75837      -10     
============================================
  Files          6064     6064              
  Lines        344500   344500              
  Branches      49575    49575              
============================================
- Hits         252733   252659      -74     
- Misses        71599    71686      +87     
+ Partials      20168    20155      -13     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@reta
reta merged commit 723abcb into opensearch-project:main Jun 12, 2026
22 checks passed
KhishorekumarBS pushed a commit to KhishorekumarBS/OpenSearch that referenced this pull request Jul 3, 2026
Signed-off-by: Andriy Redko <drreta@gmail.com>
@marko-bekhta

Copy link
Copy Markdown

hey @reta 👋🏻
I noticed this deprecation during the upgrade and am trying to understand: what is an actual alternative to it?

we have an OpenSearch-based client in Hibernate Search (https://github.com/hibernate/hibernate-search/tree/main/backend/elasticsearch-client/opensearch-rest-client) that users can use when connecting to OpenSearch clusters. Neither high-level (my understanding is that you plan to deprecate it anyway, and it's not suitable in the first place for the use case 🙂) nor the opensearch-Java clients, which are suggested, look like a good alternative here ...

Why the current RestClient was a good fit -- we need a client that can talk to any OpenSearch version without bringing version specifics with it. Hibernate Search can handle versions internally, but it needs something to handle the node management + sending requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-diff-analyzer Maintainer to skip code-diff-analyzer check, after reviewing issues in AI analysis. v3.8.0 Issues and PRs related to version 3.8.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[META] Deprecate REST client

3 participants