Skip to content

Imperative Redis support auto-configured in WebFlux based applications #29107

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

Closed
vpavic opened this issue Dec 17, 2021 · 1 comment
Closed

Imperative Redis support auto-configured in WebFlux based applications #29107

vpavic opened this issue Dec 17, 2021 · 1 comment
Labels
status: duplicate A duplicate of another issue

Comments

@vpavic
Copy link
Contributor

vpavic commented Dec 17, 2021

A simple WebFlux based application consisting of spring-boot-starter-webflux and spring-boot-starter-data-redis-reactive dependencies will result in imperative Redis support (namely, RedisTemplate<Object, Object> and StringRedisTemplate beans) being auto-configured.

This is because beans auto-configured by RedisAutoConfiguration (the ones listed earlier) are conditional on presence of imperative RedisConnectionFactory which is always the case with Lettuce due to LettuceConnectionFactory implementing both RedisConnectionFactory and ReactiveRedisConnectionFactory. This potentially sets up users for failure by configuring components that really shouldn't be available on a non-blocking runtime.

I'm not sure if there are other places where something like this is possible, but similarly like with #15574, it feels like Spring Boot could offer conditions to determine whether the runtime is Servlet or WebFlux based.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 17, 2021
@snicoll
Copy link
Member

snicoll commented Dec 18, 2021

Thanks, we are aware and have been brainstorming about this already, see #22692

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants