Remove support for embedded MongoDB
This commit removes auto-configuration and dependency management for Flapdoodle embedded MongoDB in favor of the Spring Boot support provided by Flapdoodle. Closes gh-30863
This commit is contained in:
@@ -249,7 +249,6 @@ boot-features-connecting-to-mongodb=features.nosql.mongodb.connecting
|
||||
boot-features-mongo-template=features.nosql.mongodb.template
|
||||
boot-features-spring-data-mongodb-repositories=features.nosql.mongodb.repositories
|
||||
boot-features-spring-data-mongo-repositories=features.nosql.mongodb.repositories
|
||||
boot-features-mongo-embedded=features.nosql.mongodb.embedded
|
||||
boot-features-neo4j=features.nosql.neo4j
|
||||
boot-features-connecting-to-neo4j=features.nosql.neo4j.connecting
|
||||
boot-features-spring-data-neo4j-repositories=features.nosql.neo4j.repositories
|
||||
@@ -806,7 +805,6 @@ features.nosql.mongodb=data.nosql.mongodb
|
||||
features.nosql.mongodb.connecting=data.nosql.mongodb.connecting
|
||||
features.nosql.mongodb.template=data.nosql.mongodb.template
|
||||
features.nosql.mongodb.repositories=data.nosql.mongodb.repositories
|
||||
features.nosql.mongodb.embedded=data.nosql.mongodb.embedded
|
||||
features.nosql.neo4j=data.nosql.neo4j
|
||||
features.nosql.neo4j.connecting=data.nosql.neo4j.connecting
|
||||
features.nosql.neo4j.repositories=data.nosql.neo4j.repositories
|
||||
|
||||
@@ -96,7 +96,6 @@
|
||||
:ant-docs: https://ant.apache.org/manual
|
||||
:dependency-management-plugin-code: https://github.com/spring-gradle-plugins/dependency-management-plugin
|
||||
:dynatrace-help: https://www.dynatrace.com/support/help
|
||||
:embedded-mongo-code: https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo/blob/de.flapdoodle.embed.mongo-{embedded-mongo-version}
|
||||
:gradle-docs: https://docs.gradle.org/current/userguide
|
||||
:hibernate-docs: https://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html
|
||||
:java-api: https://docs.oracle.com/javase/8/docs/api
|
||||
|
||||
@@ -136,27 +136,6 @@ TIP: For complete details of Spring Data MongoDB, including its rich object mapp
|
||||
|
||||
|
||||
|
||||
[[data.nosql.mongodb.embedded]]
|
||||
==== Embedded Mongo
|
||||
Spring Boot offers auto-configuration for https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo[Embedded Mongo].
|
||||
To use it in your Spring Boot application, add a dependency on `de.flapdoodle.embed:de.flapdoodle.embed.mongo` and set the configprop:spring.mongodb.embedded.version[] property to match the version of MongoDB that your application will use in production.
|
||||
|
||||
NOTE: The default download configuration allows access to most of the versions listed in {embedded-mongo-code}/src/main/java/de/flapdoodle/embed/mongo/distribution/Version.java[Embedded Mongo's `Version` class] as well as some others.
|
||||
Configuring an inaccessible version will result in an error when attempting to download the server.
|
||||
Such an error can be corrected by defining an appropriately configured `DownloadConfigBuilderCustomizer` bean.
|
||||
|
||||
The port that Mongo listens on can be configured by setting the configprop:spring.data.mongodb.port[] property.
|
||||
To use a randomly allocated free port, use a value of 0.
|
||||
The `MongoClient` created by `MongoAutoConfiguration` is automatically configured to use the randomly allocated port.
|
||||
|
||||
NOTE: If you do not configure a custom port, the embedded support uses a random port (rather than 27017) by default.
|
||||
|
||||
If you have SLF4J on the classpath, the output produced by Mongo is automatically routed to a logger named `org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongo`.
|
||||
|
||||
You can declare your own `IMongodConfig` and `IRuntimeConfig` beans to take control of the Mongo instance's configuration and logging routing.
|
||||
The download configuration can be customized by declaring a `DownloadConfigBuilderCustomizer` bean.
|
||||
|
||||
|
||||
[[data.nosql.neo4j]]
|
||||
=== Neo4j
|
||||
https://neo4j.com/[Neo4j] is an open-source NoSQL graph database that uses a rich data model of nodes connected by first class relationships, which is better suited for connected big data than traditional RDBMS approaches.
|
||||
|
||||
@@ -558,14 +558,7 @@ TIP: A list of the auto-configuration settings that are enabled by `@DataMongoTe
|
||||
|
||||
The following class shows the `@DataMongoTest` annotation in use:
|
||||
|
||||
include::code:withoutdb/MyDataMongoDbTests[]
|
||||
|
||||
In-memory embedded MongoDB generally works well for tests, since it is fast and does not require any developer installation.
|
||||
If, however, you prefer to run tests against a real MongoDB server, you should exclude the embedded MongoDB auto-configuration, as shown in the following example:
|
||||
|
||||
include::code:withdb/MyDataMongoDbTests[]
|
||||
|
||||
|
||||
include::code:MyDataMongoDbTests[]
|
||||
|
||||
[[features.testing.spring-boot-applications.autoconfigured-spring-data-neo4j]]
|
||||
==== Auto-configured Data Neo4j Tests
|
||||
|
||||
Reference in New Issue
Block a user