EdgeX Registry Abstraction
Decouple EdgeX services from Consul
https://github.com/edgexfoundry/edgex-go/issues/797
Existing state
config-seed
init.go
- Checks if Consul is available by attempting to access /v1/agent/self path on consul service
- If available, returns pointer to Client
populate.go
- PUT properties into Consul KV (legacy Java services) – Obsolete now?
- PUT configuration into Consul KV
* Does GET on each KV prior to PUT
Requirements
- Check if Registry Service running
- Create NewRegistry if running
- GET configuration values from Registry Service(nil if not there)
- PUT configuration values into Registry Service
All Others services
use internal/pkg/consul/client.go
- Uses mitchellh/consulstructure for watching for configuration changes
Requirements
- Register service with Registry Service
- Register health check URL with Registry Service
- Load configuration from Registry Service and map values into configuration struct
- Watch for configuration changes in Registry Service and notify current service with latest configuration
- Get service endpoint information
device-sdk-go
clients/init.go
- checks if Consul service is available
- checks in dependent services are available
internal/pkg/consul/client.go
- Similar to version in edgex-go, but doesn't use mitchellh/consulstructure to watch for changes
Requirements
- Check if dependent services are available.
- Same as edgex-go microservices