Giter Club home page Giter Club logo

core-config-watcher's Introduction

Main Author: Cloud Tsai

Copyright 2016-17, Dell, Inc.

If the client micro service requires reloading the configuration data dynamically at runtime and it is not based on Spring Cloud Consul (if yes, see the next section), it needs to implement a callback API to do the reloading action. Configuration Management sends a HTTP GET request to the callback API, when it detects any change which is related to the client micro service on the Key/Value Store. This function leverages Consul Watches and a simple tool called core-config-watcher. Consul Watches are a way of specifying a view of data (e.g. Key/Value pairs or health checks) which is monitored for updates. When an update is detected, an external handler is invoked. A handler can be any executable. In our case, the external handler is edgex-core-config-watcher which executes the following tasks:

  1. Accept an argument as the micro service id.
  2. Use this micro service id to query a specific property named "config.notification.path" from the Key/Value Store, and the URL might be like "/ping?config_changed=true" Sending GET request to http://localhost:8500/v1/kv/config/edgex-core-data/config.notification.path to retrieve the relative path.
  3. Use this micro service id to discover the address and service port number of the microservice. Sending GET request to http://localhost:8500/v1/catalog/service/edgex-core-data to retrieve the address and service port variable.
  4. Send http request to the completed notification URL from 2) and 3). Maybe, it looks like https://edgex-core-data:48080/ping?config_changed=true The path of callback API is stored in a configuration property in the Key/Value Store, and its naming convention is "config.notification.path". If there is no "config.notification.path" configuration for the micro service, edgex-core-config-watcher will exit on step 2).

core-config-watcher's People

Contributors

trcox avatar tykeal avatar jpwhitemn avatar

Watchers

Jeremy Phelps avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.