# How come RefreshResponse is missing in 8.13.0. Needed for RHLC compatibility with v8

**URL:** <https://discuss.elastic.co/t/how-come-refreshresponse-is-missing-in-8-13-0-needed-for-rhlc-compatibility-with-v8/359678>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [May 17, 2024, 2:41am UTC](https://discuss.elastic.co/t/how-come-refreshresponse-is-missing-in-8-13-0-needed-for-rhlc-compatibility-with-v8/359678 "2024-05-17T02:41:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![buitcj](https://avatars.discourse-cdn.com/v4/letter/b/a587f6/32.png) [@buitcj](https://discuss.elastic.co/u/buitcj)\
**Post date:** [May 17, 2024, 2:41am UTC](https://discuss.elastic.co/t/how-come-refreshresponse-is-missing-in-8-13-0-needed-for-rhlc-compatibility-with-v8/359678/1 "2024-05-17T02:41:29Z")

</div>

This file/class exists in 8.12.2 ([elasticsearch/server/src/main/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponse.java at v8.12.2 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/blob/v8.12.2/server/src/main/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponse.java)) but is gone starting in 8.13.0. I didn't see any mention of it in [the release notes](https://www.elastic.co/guide/en/elasticsearch/reference/current/release-notes-8.13.0.html)

The Java High Level REST Client is [supposed to be compatible with v8 in compatibility mode](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-compatibility.html), but the API `public RefreshResponse refresh(RefreshRequest refreshRequest, RequestOptions options)` can no longer work if RefreshResponse is missing...right?

What am I misunderstanding here?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 17, 2024, 8:49am UTC](https://discuss.elastic.co/t/how-come-refreshresponse-is-missing-in-8-13-0-needed-for-rhlc-compatibility-with-v8/359678/2 "2024-05-17T08:49:16Z")

</div>

The class you are looking at is on the server side. Not the client side.

The HLClient does not exist after 7.17.  
So you should either stay on the 7.17 HLClient (which I don't recommend) or switch to the new client. See my blog post: [Switching from the Java High Level Rest Client to the new Java API Client | Elastic Blog](https://www.elastic.co/blog/switching-from-the-java-high-level-rest-client-to-the-new-java-api-client)

---

<div class="post-metadata">

**Author:** ![buitcj](https://avatars.discourse-cdn.com/v4/letter/b/a587f6/32.png) [@buitcj](https://discuss.elastic.co/u/buitcj)\
**Post date:** [May 17, 2024, 1:30pm UTC](https://discuss.elastic.co/t/how-come-refreshresponse-is-missing-in-8-13-0-needed-for-rhlc-compatibility-with-v8/359678/3 "2024-05-17T13:30:15Z")

</div>

I understand that RequestResponse is on the server side but RHLC 7 claims to be compatible with server v8 (using compatibility mode). So I'd expect that a RHLC v7 API continues to work with server v8 libraries.

Secondly, why would RefreshRequest exist but not the RefreshResponse?

> So you should either stay on the 7.17 HLClient (which I don't recommend)

ES docs actually outline a [migration strategy](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/migrate-hlrc.html#_transition_strategies) wherein you continue to use the RHLC v7 until you can slowly switch over to the new java APIs which we're doing.

---

<div class="post-metadata">

**Author:** ![swallez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swallez/32/11972_2.png) [@swallez](https://discuss.elastic.co/u/swallez)\
**Post date:** [May 17, 2024, 2:37pm UTC](https://discuss.elastic.co/t/how-come-refreshresponse-is-missing-in-8-13-0-needed-for-rhlc-compatibility-with-v8/359678/4 "2024-05-17T14:37:33Z")

</div>

RefreshResponse exists in the Java API client: [elasticsearch-java/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/RefreshResponse.java at main · elastic/elasticsearch-java · GitHub](https://github.com/elastic/elasticsearch-java/blob/main/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/RefreshResponse.java)

---

<div class="post-metadata">

**Author:** ![buitcj](https://avatars.discourse-cdn.com/v4/letter/b/a587f6/32.png) [@buitcj](https://discuss.elastic.co/u/buitcj)\
**Post date:** [May 17, 2024, 5:07pm UTC](https://discuss.elastic.co/t/how-come-refreshresponse-is-missing-in-8-13-0-needed-for-rhlc-compatibility-with-v8/359678/5 "2024-05-17T17:07:19Z")

</div>

@swallez I'm not sure, but I don't think the class you linked to helps. The RHLC API uses org.elasticsearch.action.admin.indices.refresh.RefreshResponse but the elasticsearch-java class is in package `co.elastic.clients.elasticsearch.indices` meaning it's not the same one

---

<div class="post-metadata">

**Author:** ![swallez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swallez/32/11972_2.png) [@swallez](https://discuss.elastic.co/u/swallez)\
**Post date:** [May 17, 2024, 5:21pm UTC](https://discuss.elastic.co/t/how-come-refreshresponse-is-missing-in-8-13-0-needed-for-rhlc-compatibility-with-v8/359678/6 "2024-05-17T17:21:49Z")

</div>

It is indeed a different class. The RHLC and Java API client are different libraries that both allow calling the Elasticsearch API.

You can use both in an application, but for a single API call you have to use one or the other. In other words, calling the refresh API with the RHLC will give you a RHLC response.

Calling the refresh API with the Java API client will give you a Java API client response. They both have the same name, are distinct classes that live in different libraries and different packages.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 18, 2024, 7:33am UTC](https://discuss.elastic.co/t/how-come-refreshresponse-is-missing-in-8-13-0-needed-for-rhlc-compatibility-with-v8/359678/7 "2024-05-18T07:33:57Z")

</div>

I don't understand what you are doing.

If you are using the HLClient 7.17, why do you need the class from the server version 8?  
Just use the classes provided by the client.

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [May 20, 2024, 5:43am UTC](https://discuss.elastic.co/t/how-come-refreshresponse-is-missing-in-8-13-0-needed-for-rhlc-compatibility-with-v8/359678/8 "2024-05-20T05:43:51Z")

</div>

> [@buitcj](#):
>
> So I'd expect that a RHLC v7 API continues to work with server v8 libraries.

I don't know where this expectation came from, but its definitely not what "compatible with" means.

The compatibility that is offered is that the HLRC can send JSON requests and receive JSON responses from an Elasticsearch 8.x server. It does not mean that the HLRC uses the server code, or that it is safe to use the HLRC on a classpath that has the 8.x server jars on it.

---

<div class="post-metadata">

**Author:** ![buitcj](https://avatars.discourse-cdn.com/v4/letter/b/a587f6/32.png) [@buitcj](https://discuss.elastic.co/u/buitcj)\
**Post date:** [May 20, 2024, 2:41pm UTC](https://discuss.elastic.co/t/how-come-refreshresponse-is-missing-in-8-13-0-needed-for-rhlc-compatibility-with-v8/359678/9 "2024-05-20T14:41:31Z")

</div>

Thanks for all your responses.

This thread was really motivated by upgrading out test infrastructure to use es8 and this thread is related to [NPE Initializing PluginsService in ES8 - #3 by buitcj](https://discuss.elastic.co/t/npe-initializing-pluginsservice-in-es8/359667/3) in that our test infra was relying embedded mode. If embedded mode is no longer supported then we don't need to have the es8 server libraries in the same process, and there shouldn't be a library conflict anymore. This now makes sense to me.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 17, 2024, 2:42pm UTC](https://discuss.elastic.co/t/how-come-refreshresponse-is-missing-in-8-13-0-needed-for-rhlc-compatibility-with-v8/359678/10 "2024-06-17T14:42:32Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
