Skip to content
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

A RestClientBuilder bean is not defined when RestHighLevelClient is unavailable #28655

Closed

Conversation

filiphr
Copy link
Contributor

@filiphr filiphr commented Nov 12, 2021

This commits exposes the RestClientBuilder as a bean even when the RestHighLevelClient is not available
It allows users to create their own RestClient beans using the Spring Boot configured RestClientBuilder
when they are not using the RestHighLevelClient.

In addition to that a new ElasticsearchRestClientHealthIndicator decoupled from the RestHighLevelClient has been added
and is used as an elasticsearch health contributor when there are no RestHighLevelClient beans.

This is similar to PR #28496, with the difference being that this is a potential proposal for 2.6.0. With this people can freely remove the dependency on the RestHighLevelClient and have all the benefits from Spring Boot in 2.6.


private final JsonParser jsonParser;
@Deprecated
public class ElasticsearchRestHealthIndicator extends ElasticsearchRestClientHealthIndicator {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really wanted to avoid deprecating this. However, it is not possible to use this class when the RestHighLevelClient is not available.

@bclozel bclozel added the for: team-attention An issue we'd like other members of the team to review label Nov 12, 2021
This commits exposes the RestClientBuilder as a bean even when the RestHighLevelClient is not available
It allows users to create their own RestClient beans using the Spring Boot configured RestClientBuilder
when they are not using the RestHighLevelClient.

In addition to that a new ElasticsearchRestClientHealthIndicator decoupled from the RestHighLevelClient has been added
and is used as an elasticsearch health contributor when there are no RestHighLevelClient beans.
@bclozel bclozel self-assigned this Nov 15, 2021
@bclozel bclozel added type: bug A general bug and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Nov 15, 2021
@bclozel bclozel added this to the 2.6.0 milestone Nov 15, 2021
@bclozel bclozel closed this in d6bead1 Nov 15, 2021
@bclozel
Copy link
Member

bclozel commented Nov 15, 2021

@filiphr I've merged this PR, removing the bits about the health indicators.
While that part was totally valid, we're really late in the milestone phase and we repurposed this PR as a bug to only fix the RestClientBuilder auto-configuration part.

I know this won't solve everything on your side, but I hope it will make things a bit easier for the 2.6.x timeline.

@filiphr filiphr deleted the expose-rest-client-builder branch November 15, 2021 10:20
@wilkinsona wilkinsona changed the title Expose RestClientBuilder when RestHighLevelClient is not available A RestClientBuilder bean is not defined when RestHighLevelClient is unavailable Nov 15, 2021
@filiphr
Copy link
Contributor Author

filiphr commented Nov 15, 2021

Thanks a lot for bringing this into the 2.6.x timeline @bclozel. It helps us a lot to properly use the Spring Boot support here.

removing the bits about the health indicators.

I completely understand this. I was not entirely sure about it left it there to leave it up to you. Adding our own health contributor is super trivial.

Does the change about the health contributors make sense for the 2.7 release? If yes I will bring those changes to PR #28496

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants