Skip to content

[BUG] SDK is not working with OpenSearch 2.x #345

@ryanbogan

Description

@ryanbogan

The SDK is currently not working on OpenSearch 2.x, because the client library was changed for OpenSearch 3.x. This can be reproduced by changing the opensearch variable in the SDK build.gradle file to 2.6.0-SNAPSHOT. The opensearch-java client must be changed to be 3.0.0-SNAPSHOT to avoid a different compile error. Then, run ./gradlew helloWorld, which gives the following error:

/home/ubuntu/opensearch-sdk-java/src/main/java/org/opensearch/sdk/SDKClient.java:21: error: package org.apache.hc.core5.function does not exist
import org.apache.hc.core5.function.Factory;
                                   ^
/home/ubuntu/opensearch-sdk-java/src/main/java/org/opensearch/sdk/SDKClient.java:22: error: package org.apache.hc.core5.http does not exist
import org.apache.hc.core5.http.HttpHost;
                               ^
/home/ubuntu/opensearch-sdk-java/src/main/java/org/opensearch/sdk/SDKClient.java:23: error: package org.apache.hc.client5.http.ssl does not exist
import org.apache.hc.client5.http.ssl.NoopHostnameVerifier;
                                     ^
/home/ubuntu/opensearch-sdk-java/src/main/java/org/opensearch/sdk/SDKClient.java:24: error: package org.apache.hc.client5.http.ssl does not exist
import org.apache.hc.client5.http.ssl.ClientTlsStrategyBuilder;

There are more instances of the same error, but I did not include them.

Edit:
We will be creating a new branch to coincide with the 2.x branch on the OpenSearch repository. The action item for this issue is to ensure that this branch has the same functionality, but with the 2.6.0 snapshot from OpenSearch.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions