Use a random port with embedded Mongo by default

This commit improves the logic of the embedded Mongo support to use a
random port if no custom port has been specified. This doesn't change
the default if the embedded support isn't active.

Closes gh-8044
This commit is contained in:
Stephane Nicoll
2017-01-20 12:08:32 +01:00
parent b900a3efc8
commit b19d31e067
3 changed files with 63 additions and 62 deletions

View File

@@ -3446,6 +3446,9 @@ property. To use a randomly allocated free port use a value of zero. The `MongoC
created by `MongoAutoConfiguration` will be automatically configured to use the randomly
allocated port.
NOTE: If you do not configure a custom port, the embedded support will use a random port
by default (rather than 27017).
If you have SLF4J on the classpath, output produced by Mongo will be automatically routed
to a logger named `org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongo`.