Hello! You can refer to this github issue which describes the same problem, and use the proposed workaround. To summarize, yes 7.x is still supported, but the java client is forward compatible, not backward (as the readme states); this is because the server might add/remove parameters, and newer versions of the client will always match the current server version.
Thank you for the link - I tried setting ApiTypeHelper.DANGEROUS_disableRequiredPropertiesCheck(true), but now get:
java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "co.elastic.clients.util.ApiTypeHelper.requireNonNull(Object, Object, String)" is null
I guess if the property is missing then the value is null. Perhaps there is another DANGEROUS_... option?
Ah that's unfortunate, it's the same case as in the issue, and the workaround doesn't work. The solution here is either to update the server version, or to use the low level rest client to perform the call, which will bypass any form of validation and just return pure json:
Response health = restClient.performRequest(new Request("GET", "/_cluster/health"));
String jsonResponse = new String(health.getEntity().getContent().readAllBytes(), UTF_8);
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.