Git Product home page Git Product logo

Comments (5)

swallez avatar swallez commented on July 21, 2024

Starting with version 7.16, the Java client sends these headers to be compatible with Elasticsearch 8.0 that will have a "7.0 compatible mode" to ease the transition to this new major version.

The server-side part of this migration logic was added to Elasticsearch 7.14, and therefore the Java client requires Elasticsearch 7.14 or more. See also our compatibility guarantees.

from elasticsearch-java.

kid1412621 avatar kid1412621 commented on July 21, 2024

Starting with version 7.16, the Java client sends these headers to be compatible with Elasticsearch 8.0 that will have a "7.0 compatible mode" to ease the transition to this new major version.

The server-side part of this migration logic was added to Elasticsearch 7.14, and therefore the Java client requires Elasticsearch 7.14 or more. See also our compatibility guarantees.

Hi there, I'd like to know if the latest version of java API client supports RestHighLevelClientBuilder#setApiCompatibilityMode. ref: elastic/elasticsearch#51816 (comment)

from elasticsearch-java.

kid1412621 avatar kid1412621 commented on July 21, 2024

Hi @swallez, I found a really wired case:

 RestClient restClient = RestClient.builder(
                        new HttpHost("localhost", 9200)).build();

        RestHighLevelClient hlrc = new RestHighLevelClientBuilder(restClient)
                .setApiCompatibilityMode(false)    // disable the compatibility headers
                .build();

        RestClientOptions restClientOptions = new RestClientOptions(RequestOptions.DEFAULT);

        ElasticsearchTransport transport = new RestClientTransport(
                hlrc.getLowLevelClient(), new JacksonJsonpMapper(), restClientOptions);  // override the default headers

        ElasticsearchClient client = new ElasticsearchClient(transport)
                .withTransportOptions(restClientOptions);  // override the default headers again, it seems this don't override above config

Even configured as above, won't disable thoese headers. And it seems something happened here.

from elasticsearch-java.

swallez avatar swallez commented on July 21, 2024

The compatibility mode on the High Level Rest Client only applies to that class, and not to the lower level Rest Client (that one only deals with raw requests and responses). This "opt in" behavior was introduced because it was changing the default behavior of High Level Rest Client.

For Java API client we made a different choice: since the compatibility mode is supported in Elasticsearch since version 7.14 and the Java API client was released as GA in 7.16, we decided to always send the version compatibility information to ease the future transition to Elasticsearch version 8.0 without requiring any change to application code.

from elasticsearch-java.

kid1412621 avatar kid1412621 commented on July 21, 2024

The compatibility mode on the High Level Rest Client only applies to that class, and not to the lower level Rest Client (that one only deals with raw requests and responses). This "opt in" behavior was introduced because it was changing the default behavior of High Level Rest Client.

For Java API client we made a different choice: since the compatibility mode is supported in Elasticsearch since version 7.14 and the Java API client was released as GA in 7.16, we decided to always send the version compatibility information to ease the future transition to Elasticsearch version 8.0 without requiring any change to application code.

Good to know, thanks.

from elasticsearch-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.