edgexfoundry / core-data-go

3 stars 10 forks source link

Go Core Data using Consul #17

Open jpwhitemn opened 6 years ago

jpwhitemn commented 6 years ago

For California Release - get Go core data configuration into config-seed and have Go metadata use Consul on initialization

feclare commented 6 years ago

Metadata is using consul: https://github.com/edgexfoundry/core-metadata-go/blob/3c338571bbb524f2d499fd1e4a3469648286b81b/StartMetadata.go#L52

We are using several different profiles for each microservice with each one having a different prefix in consul(/config/core-data, /config/core-data;docker, /config/core-data;go, /config/core-data;docker;go). Should not be better to only have a prefix for each microservice(config/core-metadata) and modify config-seed to be able to initialize the key store with the correct values for each profile. Having in config-seed something like: core-config-seed/config/docker/metadata core-config-seed/config/docker/data ... core-config-seed/config/localhost/metadata core-config-seed/config/localhost/data ... instead of: core-config-seed/config/metadata core-config-seed/config/metadata;docker core-config-seed/config/data core-config-seed/config/data;docker ... In this way we can simplify the microservices, as they will need to know nothing about profiles. And it will be also be easier to manage consul, as there will be only one entry for each microservice, knowing which configuration will read each microservice. The only downside is that each microservice implementation (go, java) will share the same prefix, polluting the prefix with data from both implementations if ever run on the same consul instance.