All the configurations start on a database property disabled
See original GitHub issueI’ve noticed that all the AutoConfiguration classes have annotation like this @ConditionalOnProperty(name = "embedded.postgresql.enabled", matchIfMissing = true)
It is not affected by the actual value of enabled
as it is expected to disable the start of configuration.
If it was supposed to disable start with the property embedded.containers.enabled
and annotations
@ConditionalOnExpression("${embedded.containers.enabled:true}"
than:
- It has ambiguous naming. Why should we have
embedded.postgresql.enabled
if it doesn’t affect anything actually? - If I want to start multiple amounts of different containers then it is not possible as either, I disable all the configurations with
embedded.containers.enabled
or keep enabled all of it.
Thus, I suggest expecting true
for each auto-configuration:
@ConditionalOnProperty(name = "embedded.postgresql.enabled", havingValue = "true", matchIfMissing = true)
Expected:
Setting1 | Setting2 | Outcome |
---|---|---|
embedded.containers.enabled=false | embedded.memsql.enabled=true embedded.mysql.enabled=true | Memsql wil not start, mySql will not start |
embedded.containers.enabled=true | embedded.memsql.enabled=false embedded.mysql.enabled=true | Memsql will not start, mySql will start |
embedded.containers.enabled=true | embedded.memsql.enabled=true, embedded.mysql.enabled=true | Memsql will start, mySql will start |
embedded.containers.enabled is missing | embedded.memsql.enabled is missing | Memsql will start |
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Disable all Database related auto configuration in Spring Boot
Last step is to disable Auto Configuration from main spring boot class: ... For disabling all the database related autoconfiguration and exit from:....
Read more >Enforce or disable startup options in database - Office
Start Access. Open an Access database project. Press ALT + F11 to open the Visual Basic editor. In the Visual Basic ...
Read more >3 Managing Broker Configurations - Oracle Help Center
A broker configuration, when first created using DGMGRL, is in a disabled condition. This means its constituent databases are not yet under active...
Read more >Disable Spring Data Auto Configuration - Baeldung
In this quick tutorial, we'll explore two different ways to disable database auto-configuration in Spring Boot. This can come in handy when ...
Read more >Configuration properties | Bitbucket Data Center and Server 8.6
Draining database connections during backup happens in two stages. Stage 1 passively waits a set amount of time for all connections to be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I see, please add container disabling property directly to you gradle junit task likewise
systemProperty("spring.profiles.active", "mysql, test")
The init phase of spring boot container is bootstrap phase of spring boot app, which comes right before the application phase. application properties are red only on application phase of your app, whereas bootstrap properties are read on bootstrap phase, so either you need to add additional set of
bootstrap-{db}.properties
files, or set as program variables or systems onesall containers are enabled by default, you need to disable unneeded, not enable needed =)