-
Notifications
You must be signed in to change notification settings - Fork 40.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Elasticsearch RestClient auto-configuration #22358
Comments
Thanks for the report. I can see the documentation does not match what the auto-configuration does as far as I can see and I am not sure I understand why. I don't see a way to create a In any case, we should not create the high-level client if a As for the sample above, You should not inject I've flagged this issue for team attention to see if someone else on the team can fill the blanks. |
I guess this is mainly a documentation issue. It should be instead:
In your case @latuszek, your bean method could be returning a |
Thanks @bclozel. |
While this isn't possible to create a With that taken into consideration and what the code currently does, it would be nicer if we didn't configure a We could probably add a warning in the documentation about this use case and change the behaviour in the next feature release if we think that makes sense. I've flagged this for team attention. |
I agree with @snicoll here.
|
After discussing this with the team, we've decided the following:
|
spring-boot-starter-parent v2.3.1.RELEASE
elasticsearch-rest-high-level-client (version inherited from parent above)
According to spring-boot documentation:
In our project, we have a single
RestClient
bean registered in spring context:Spring actuator health endpoint returns correct response regarding connection to Elasticsearch (uses our parameters etc.).
However when we're trying to use injected
RestHighLevelClient
to connect (e.g. usingclient.cluster().health(new ClusterHealthRequest(), RequestOptions.DEFAULT);
it connects using default parameters from spring-boot.The text was updated successfully, but these errors were encountered: