question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

All the configurations start on a database property disabled

See original GitHub issue

I’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:

  1. It has ambiguous naming. Why should we have embedded.postgresql.enabled if it doesn’t affect anything actually?
  2. 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:closed
  • Created 3 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tdanylchukcommented, Jan 20, 2021

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 ones

0reactions
tdanylchukcommented, Jan 20, 2021

all containers are enabled by default, you need to disable unneeded, not enable needed =)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found