Migrate from HLRC to elasticsearch-java 8.x client#920
Open
Yeikel Santana (yeikel) wants to merge 3 commits into
Open
Migrate from HLRC to elasticsearch-java 8.x client#920Yeikel Santana (yeikel) wants to merge 3 commits into
Yeikel Santana (yeikel) wants to merge 3 commits into
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
| @@ -0,0 +1,37 @@ | |||
| name: CI | |||
There was a problem hiding this comment.
Can be removed before we merge. This was added to help me test end to end rather than locally only
| <!-- switch statements on types exceed maximum complexity --> | ||
| <suppress | ||
| checks="(CyclomaticComplexity)" | ||
| checks="(CyclomaticComplexity|NPathComplexity)" |
There was a problem hiding this comment.
My goal with the migration was to producer the smaller diff possible. I can definitely fix this but the diff will be much larger. I think that it makes sense to take this in a subsequent change
45ad48c to
e34f70d
Compare
This was referenced May 15, 2026
696f259 to
6157170
Compare
Replace the deprecated High Level REST Client with the new elasticsearch-java 8.x client.
6157170 to
5bee901
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The High Level REST Client (HLRC) is deprecated and was fully removed in Elasticsearch 9, blocking support for ES 9.x. The connector currently depends on
elasticsearch-rest-high-level-client 7.x.Fixes #847.
Breaking change: This migration drops support for Elasticsearch 7.x, which reached end of life in January 15, 2026. The minimum supported version is now Elasticsearch 8.x.
Solution
Replace HLRC with
co.elastic.clients:elasticsearch-java 8.19.15.Dependencies
elasticsearch-rest-high-level-clientandelasticsearch(HLRC artifacts)co.elastic.clients:elasticsearch-java 8.19.15andelasticsearch-rest-client 8.19.15log4j-bom 2.25.4to align transitive log4j versionselasticsearch-java)Core client
BulkProcessor→BulkIngester<SinkRecordAndOffset>: offset state is carried as context on each bulk operation instead of being looked up in a side mapDispatchingTransport— dispatches async callbacks to a dedicated executor, breaking a lock-ordering deadlock betweenBulkIngester's internal condition and the NIO thread poolBackoffPolicy.exponentialBackoffData layer
DataConverter.convertRecord(): returnsBulkOperationinstead ofDocWriteRequestMapping.buildMapping(): returnsMap<String, Object>instead ofXContentBuilderVersionType.EXTERNAL) inlined — no direct equivalent in the new APISSL startup scripts
chmod 777 ${ES_DIR}— script runs aselasticsearchuser which cannot chmod its own install directorysu - elasticsearch << EOFheredoc withexec /usr/local/bin/docker-entrypoint.sh eswrapper(ES 8.x process supervisor with correct signal forwarding)openssl pkcs12withelasticsearch-certutilfor PKCS12 client cert generationPATHupdate for the bundled JDK is now conditional onkeytoolnot already being presentDoes this solution apply anywhere else?
If yes, where?
Test Strategy
Existing integration tests
Testing done:
Release Plan
Merge to master. No back port needed as this is a forward-only migration and it is not backwards compatible. We should consider releasing 16.x for this change
Notes
The client support Java 8, but I think that this could be a good opportunity to bump it to a higher version like 11 or 17.
The commit
fc7f57d5(.github/workflows/ci.yml): was added only to run the test suite via GitHub Actions since I don't have access to Confluent's Semaphore CI. This should be dropped before mergingThe commit
802f8780(testcontainers 1.16.3 → 1.21.4): can be extracted into a standalone PR if preferred. It was required here because 1.16.3 fails against Docker Engine 29.x. which is what GitHub Action uses