-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Support disabling of redis autoconfiguration via config property. #4678
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
Conversation
This looks fishy to me. What bean type are you talking about? (can you include a stacktrace?). IMO, if Spring Boot should auto-configure X and more than one bean of type X exists, it should just back-off. |
Here is the stacktrace after defining two
|
@sbuettner Can you show a bit more of the stacktrace, please? Specifically, it'd be useful to see which bean was being created when it couldn't find a unique bean. |
@wilkinsona Sure:
|
@snicoll Nevertheless the flag might be useful when you just want to disable the autoconfiguration. |
@sbuettner I am not denying that but I would do that consistently rather than adding enabled flags here and there. |
@snicoll ACK, the autoconfiguration part should work out of the box. |
We have such issue in other areas. IMO, JMS and RabbitMQ have the exact same issue with |
I didnt go with |
We discussed this issue today and a |
Currently you can only disable the redis autoconfiguration using the
exclude
property in the respective spring boot annotations like this@SpringBootApplication(exclude = RedisAutoConfiguration.class)
. This is needed if you have two redis connections (Spring Boots redis autoconfiguration expects a single bean). This PR introduces a singleenabled
flag that allows an application developer to control the autoconfiguration of redis more easily and in an environment dependent way.Contribution agreement number: 133520150810110320