Refer - https://github.com/spring-projects/spring-boot/issues/47301#issuecomment-3542187734 for background.

Elasticsearch Java Client 9.0.0 introduced Rest5Client which is drop-in replacement for elasticsearch-rest-client and elasticsearch-rest-client-sniffer.

Spring Boot 3 enables sniffer feature only if elasticsearch-rest-client-sniffer dependency available on classpath. On cloud deployment, it is advised to not use sniff explained in When not to sniff?. Spring Boot 4 enabled it by default. Since sniffing is optional opt-in feature, it is better to disable by default.

Disable by default keeps functionally equal to previous version.

@l-trotta @filiphr Please share your thought as well.

Comment From: filiphr

Thanks for raising this @anbusampath. We personally never used the Sniffer. With Spring Boot 4 we are also disabling that by default and leave it to our users to enable it if they want to use it.

In any case reading the blog post you've shared I can imagine that people might have more problems if sniffing is enabled by default and they do not really understand it. From that point of view I would vote for making it opt-in in Spring Boot itself as well.

Comment From: wilkinsona

I think this section of the best practices blog post is key:

The main takeaway from this is you should know your infrastructure before you enable sniffing. There are many solutions to this IP address issue, and there is no silver bullet, because it all depends on your system configuration.

We should disable it by default in Boot. Thanks for raising this, @anbusampath.