Ensure that all data store auto-configurations have consistent default connection behaviour
See original GitHub issueThis was raised as part of a discussion on Twitter. The specific example given is Mongo which connects to localhost when it’s on the classpath and Couchbase which doesn’t connect to anything until your configure at least one bootstrap host.
There may well be good reasons for the apparent inconsistency, but it appears to be causing some confusion. It would be nice to align the behaviour across data stores if we can. If there are good reasons not to do that, it would be nice to see if we can somehow make the varying behaviour less surprising.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Binding to Data Services with Spring Boot in Cloud Foundry
In this article we look at how to bind a Spring Boot application to data services (JDBC, NoSQL, messaging etc.) and the various...
Read more >A Custom Auto-Configuration with Spring Boot - Baeldung
A quick, practical guide to creating a custom auto-configuration in Spring Boot.
Read more >Spring Cloud GCP
You do not need to include the underlying spring-cloud-gcp-pubsub dependency, ... starters autoconfigure all necessary beans in the default singleton scope.
Read more >Learn about the Android Device Configuration Service
This data helps Google ensure that your device remains up-to-date and is ... Devices usually connect to the Android Device Configuration service every...
Read more >Configuring basic system settings Red Hat Enterprise Linux 8
Configuring and managing network access Expand section "3. ... Default behavior is the same as for the dnf-automatic-download.timer unit: it only downloads ...
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

The confusion for us came because of two reasons One, we have been using Couchbase without issues, and when we migrated to MongoDB we had to exclude the autoconfigurer. That felt odd.
Two, how the Autoconfiguration starts and logs the MongoClient behauviour…
Note: whe use a logback logging configuration importing springs defaults
Imho, all Autoconfigurators for components depend on some mid-complex configuration should check for properties. Simple things or when a default config is a common thing like Gson or Jackson are fine that they only check for Beans.
Btw, the reason why we have a custom connector and do not expose a MongoClient to the Spring context is because we have a multitennacy platform that manages several connections at once. We load the configurations from a config-service and then initialize all our MongoClients inside a custom bean. That bean is the exposed, but not the clients.
Neo4j is also affected in a similar way. An app will fail to start when Neo4j can’t be reached. #23707 contains some details, including failures both with and without Actuator.