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

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.

First of all, the high level rest client is deprecated. So you should directly go to the Java Client.

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. 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. I'm not using myself a sniffer as I prefer to control myself the list of the nodes I'm going to connect to.

1 Like

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?

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.

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