-
Notifications
You must be signed in to change notification settings - Fork 146
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
Reactive auto-configuration - Both health indicators VaultHealthIndicator and VaultReactiveHealthIndicator are registered in the application context #676
Comments
Imperative endpoints can be exposed via JMX. Endpoints are registered based on the presence of a This setup is common in Spring Boot itself. |
Thanks for the comment. {
"vault": {
"status": "UP",
"details": {
"version": "1.12.3"
}
},
"vaultReactive": {
"status": "UP",
"details": {
"state": "Vault in standby",
"version": "1.12.3"
}
}
} As opposed to the example I've provided where in e.g. Redis they configure only one health contributor ( |
Thanks for pointing this out. You're right, I totally missed that one indicator's configuration backs off in case of such an relationship between the beans. Feel free to submit a pull request to align the conditions, precedence, and bean names. We should also keep the |
…tor instead of both - reactive and imperative. Fixes spring-cloudgh-676
No problem, I've just submitted the pull request and it's ready for review 👍 |
Describe the bug
Hi, I'm using
Spring Cloud Vault
with theSpring WebFlux
stack:Spring Boot 3.0.3
Spring Cloud Vault 4.0.0
-spring-cloud-vault-config 4.0.0
As it is a reactive stack, Vault’s reactive auto-configuration is enabled. What seems to be a bug is that there are now 2 Vault health indicators registered in the application context - the reactive one and non-reactive one. When
/actuator/health
endpoint is called both health indicators (VaultHealthIndicator
andVaultReactiveHealthIndicator
) are executed.Or is it meant to be like that because you can have
Spring Cloud Vault
onServlet Stack (Spring MVC)
and be using Spring'sWebClient
fromorg.springframework:spring-webflux
dependency?Sample
I've created a sample test in which we can see the both indicators are registered:
Or you can check it out directly here:
VaultReactiveAutoConfigurationIssueDemonstrationSampleTests
Suggestion
I've checked other Spring Boot auto-configurations and for example here is the auto-configuration for Redis:
RedisHealthContributorAutoConfiguration
RedisReactiveHealthContributorAutoConfiguration
We can see that in RedisHealthContributorAutoConfiguration
they use the same
@ConditionalOnMissingBean
name as in RedisReactiveHealthContributorAutoConfiguration:Which would prevent the creation of the non-reactive health indicator (we would need to change the
@Import
order here as well VaultHealthIndicatorAutoConfiguration)What do you think? I would be happy to prepare and submit a pull request.
The text was updated successfully, but these errors were encountered: