Giter Club home page Giter Club logo

miniconf's Introduction

Mini Configuration Center

Overview

Centralized configuration management, including online editing, persistence, especially the change of the configuration data can be perceived in runtime.

we use Akka persistence/Http/Distributed Data. thanks for Akka toolkit, it make the source code number decreased dramatically,the core code number no more than 300 lines.

a Configuration = Group + Key + Value

Mini Configuration Center(miniconf) consists of two parts: server side and client jar.

  • server side expose RESTful service(use Akka Http) and use local/distributed akka persistence to save Add/Edit/Query configuration events and use akka Distributed Data to disseminate configuration events between cluster nodes.

  • client jar provide scala and java interface.

architecture

Usage

server side

the main class is miniconf.server.MainApp, you can run it.

web page

  • the main page url is http://your server ip:9000/ (the default port is 9000)

indexpage ###conf in conf directory, you can edit application.conf for custom need.

Reference configuration

   # cluster configure detail
   akka.cluster {
  seed-nodes = [
    "akka.tcp://[email protected]:2551"]

  auto-down-unreachable-after = 30s
}

akka {
  remote {
    log-remote-lifecycle-events = off
    netty.tcp {
      hostname = "127.0.0.1"
      port = 2551
    }
  }
}

# http service configure detail
miniconf {
  httpService {
    interface = "127.0.0.1"
    port      = 9000
  }
}

Client jar

Add One Configuration

	// create MiniConfClient instance
	val theMiniConfClient = new MiniConfClient("http://localhost:9000")
	// saveOneConfItem
	theMiniConfClient.saveOneConfItem("g2", "k1", "gv2")

Get One Configuration

	val theMiniConfClient = new MiniConfClient("http://localhost:9000")
	theMiniConfClient.getOneConfItem("g2", "k1")

Register Data modified Listener

	val theMiniConfClient = new MiniConfClient("http://localhost:9000")
	theMiniConfClient.registerListener("g2", "k1", {newValue => System.out.println("conf have modified "+newValue)})

Release Notes

0.1 (2014-8)

  • use Spray and Jetty to expose Rest Services.
  • use Akka Persistence and CQRS to save all configures in local.
  • use Akka 2.3.4.

0.2 (2016-2)

  • use Akka HTTP to expose Rest Services.
  • use Akka Persistence to persist all configures in local.
  • use Akka Distributed Data to disseminate configuration events between cluster nodes.
  • use Multi Node Testing to do integration test.
  • use Akka 2.4.1.

License

This code is open source software licensed under the Apache 2.0 License.

miniconf's People

Contributors

netcomm avatar

Watchers

YOUXIANG WANG 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.