You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use spring-boot 2.5.2 and I think that Redis health indicator autoconfiguration is not correct.
org.springframework.boot.actuate.autoconfigure.redis.RedisReactiveHealthContributorAutoConfiguration has this condition: @ConditionalOnClass({ ReactiveRedisConnectionFactory.class, Flux.class })
and I think that is incorrect because an application can be blocking and have in the classpath the Flux class. An application is reactive if use a webflux server.
For example, in my case, I use spring-boot-starter-data-redis (version 2.5.2) and transitively it is using lettuce which in turn brings reactor-core.
Therefore, the condition will always be matched and the two autoconfigurations (org.springframework.boot.actuate.autoconfigure.redis.RedisReactiveHealthContributorAutoConfiguration and org.springframework.boot.actuate.autoconfigure.redis.RedisHealthContributorAutoConfiguration) will be loaded.
I think it could be solved by adding the condition @ConditionalOnWebApplication(type=REACTIVE) for reactive autoconfiguration and @ConditionalOnWebApplication(type=SERVLET) for blocking autoconfiguration.
The text was updated successfully, but these errors were encountered:
@jorgerod thanks for the report, we're aware of the limitation. There's nothing wrong with the current state as the reactive health indicator variant is going to work just fine in your "non-reactive" app.
I use spring-boot 2.5.2 and I think that Redis health indicator autoconfiguration is not correct.
org.springframework.boot.actuate.autoconfigure.redis.RedisReactiveHealthContributorAutoConfiguration
has this condition: @ConditionalOnClass({ ReactiveRedisConnectionFactory.class, Flux.class })and I think that is incorrect because an application can be blocking and have in the classpath the Flux class. An application is reactive if use a webflux server.
For example, in my case, I use
spring-boot-starter-data-redis
(version 2.5.2) and transitively it is using lettuce which in turn bringsreactor-core
.Therefore, the condition will always be matched and the two autoconfigurations (
org.springframework.boot.actuate.autoconfigure.redis.RedisReactiveHealthContributorAutoConfiguration
andorg.springframework.boot.actuate.autoconfigure.redis.RedisHealthContributorAutoConfiguration
) will be loaded.I think it could be solved by adding the condition
@ConditionalOnWebApplication(type=REACTIVE)
for reactive autoconfiguration and@ConditionalOnWebApplication(type=SERVLET)
for blocking autoconfiguration.The text was updated successfully, but these errors were encountered: