No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download

Spring Cloud Config Server MongoDB

build-status Join the chat at

Spring Cloud Config Server MongoDB enables seamless integration of the regular Spring Cloud Config Server with MongoDB to manage external properties for applications across all environments.

Quick Start

Configure pom.xml, like this:


        <name>Spring Snapshots</name>
        <name>OJO Snapshots</name>

Create a standard Spring Boot application, like this:

public class Application {

    public static void main(String[] args) {, args);


Configure the application's* properties in application.yml, like this:

      uri: mongodb://localhost/config-db

Add documents to the config-db mongo database, like this:

use config-db;

  "label": "master",
  "profile": "prod",
  "source": {
    "user": {
      "max-connections": 1,
      "timeout-ms": 3600

In the above snippet we've configured properties for an application named gateway having profile prod and label master.

The application-name is identified by the collection's name and a MongoDB document's profile and label values represent the Spring application's profile and label respectively. Note that documents with no profile or label values will have them considered default. All properties must be listed under the source key of the document.

Finally, access these properties by invoking http://localhost:8080/master/ The response would be like this:

user.max-connections: 1.0
user.timeout-ms: 3600.0