Quantcast
Viewing all articles
Browse latest Browse all 1367

Elasticsearch RestClient version conflict

Hi,

I am using the following artifact: "org.elasticsearch.client" % "elasticsearch-rest-high-level-client" % "7.6.2"

And this high-level-client contains the RestClient class that only has the two following methods with signatures:

  • performRequestAsync(Request request, ResponseListener responseListener)
  • performRequestAsync(final NodeTuple<Iterator<Node>> nodeTuple, InternalRequest request, final FailureTrackingResponseListener listener)

But when I run the following code:

val client: RestClient = RestClient.builder(new HttpHost("myHost", 9201)).build()

    ElasticsearchSource
      .create(
        indexName = "myIndex",
        typeName = "_doc",
        query = """{"match_all": {}}"""
      )(client)
      .take(10)
      .map { msg =>
        println(s"js: ${msg.source}")
      }
      .runWith(
        Sink.ignore
      )

I get the following error:
java.lang.NoSuchMethodError: org.elasticsearch.client.RestClient.performRequestAsync(Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Lorg/apache/http/HttpEntity;Lorg/elasticsearch/client/ResponseListener;[Lorg/apache/http/Header;)V

That is because in the elasticsearch-rest-client:7.6.2 there is no such method with that signature.
This method with the asked signature was only available in elasticsearch-rest-client:6.3.1

I cannot revert back go version 6.3.1 since I need the 7.6.2 version in other places in my project.
Also I tested the 7.7.1 version and it too doesn’t have that method.

How can I get elasticsearch to work now?

Thanks,
Zarko

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 1367

Trending Articles