# Missing client level settings in high level rest client while migrating to transport client

**URL:** <https://discuss.elastic.co/t/missing-client-level-settings-in-high-level-rest-client-while-migrating-to-transport-client/326415>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [February 24, 2023, 9:03am UTC](https://discuss.elastic.co/t/missing-client-level-settings-in-high-level-rest-client-while-migrating-to-transport-client/326415 "2023-02-24T09:03:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Umang\_Pachaury](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/umang_pachaury/32/113523_2.png) [@Umang\_Pachaury](https://discuss.elastic.co/u/Umang_Pachaury)\
**Post date:** [February 24, 2023, 9:03am UTC](https://discuss.elastic.co/t/missing-client-level-settings-in-high-level-rest-client-while-migrating-to-transport-client/326415/1 "2023-02-24T09:03:11Z")

</div>

Hey Team,  
I am upgrading from transport client to high level rest client and there are some client level settings I could not find in high level rest client.

I was able to upgrade almost all the code but was not able to find some methods used for client initialization.  
`client.transport.sniff , client.transport.ping_timeout , client.transport.nodes_sampler_interval`

I found sniffer in low level client ,is that same as `client.transport.sniff` ?  
I also found `connect.timeout` and `socket.timeout` in hlrc, are those similar to `client.transport.ping_timeout`?

then what about `client.transport.nodes_sampler_interval`?

Can anyone help me in this.

---

<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:** [February 24, 2023, 9:24am UTC](https://discuss.elastic.co/t/missing-client-level-settings-in-high-level-rest-client-while-migrating-to-transport-client/326415/2 "2023-02-24T09:24:56Z")

</div>

First of all, the high level rest client is deprecated. So you should directly go to the [Java Client](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/index.html).

Then, don't think about it as a 1:1 migration. It's useless to copy/past old deprecated settings to the new way.

So for the Low Level client, just look at [Java Low Level REST Client | Elasticsearch Java API Client [8.6] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/java-rest-low.html). There's is barely no specific settings that you must set...

If you want to sniff the cluster, that's totally optional, you can use [the sniffer](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/sniffer.html). I'm not using myself a sniffer as I prefer to control myself the list of the nodes I'm going to connect to.

---

<div class="post-metadata">

**Author:** ![Umang\_Pachaury](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/umang_pachaury/32/113523_2.png) [@Umang\_Pachaury](https://discuss.elastic.co/u/Umang_Pachaury)\
**Post date:** [February 24, 2023, 9:32am UTC](https://discuss.elastic.co/t/missing-client-level-settings-in-high-level-rest-client-while-migrating-to-transport-client/326415/3 "2023-02-24T09:32:30Z")

</div>

Yes, I was thinking of upgrading to the java api client but I found the documentation a bit incomplete so for the meantime I did the HLRC and will gradually upgrade to the Java Api client. So as per the answer in my new code it is basically not needed to copy paste the old deprecated settings. So I can consider that if in the hlrc initialization if the old settings are not mentioned it is no longer needed?

---

<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:** [February 24, 2023, 10:13am UTC](https://discuss.elastic.co/t/missing-client-level-settings-in-high-level-rest-client-while-migrating-to-transport-client/326415/4 "2023-02-24T10:13:52Z")

</div>

> So I can consider that if in the hlrc initialization if the old settings are not mentioned it is no longer needed?

Yes

> so for the meantime I did the HLRC and will gradually upgrade to the Java Api client.

I'd not do that. It's a waste of time as you will have to rewrite a lot of things then.  
You should use the new client IMO.

---

<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:** [March 24, 2023, 10:14am UTC](https://discuss.elastic.co/t/missing-client-level-settings-in-high-level-rest-client-while-migrating-to-transport-client/326415/5 "2023-03-24T10:14:01Z")

</div>

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