spring-attic / spring-cloud-config-server-mongodb

Apache License 2.0
57 stars 34 forks source link

Sharing properties across microservices #23

Open kkushal05 opened 4 years ago

kkushal05 commented 4 years ago

Hi,

For a scenario that we faced as mentioned below , how can I share common properties across these 2 microservices instead of having duplicates in application.properties of microservice-one and microservice-two.

microservice-one |--- application.properties |--- application-prod.properties |--- application-dev.properties microservice-two |--- application.properties |--- application-prod.properties |--- application-dev.properties

polk1lo commented 4 years ago

Such functionality doesn't supported by this library I think.. But you can do it yourself 1) Create new collection for common properties 2) Override MongoEnvironmentRepository#findOne, call super, and additionaly call findOne for common collection and merge these 2 Environments. Not a big deal