A Distributed Configuration Service Based on gRPC.
Each comfiguration is composed of a key/value pair, where the key can be any string and value is a JSON document so that nested structured configurations can be stored.
As an use case example, we at e2log.com, use a similar service to store feature toggles and parameters for each module of our B2B SaaS platform. All feature toggles and parameters for all modules are stored in a single JSON document with the customer identifier as the key.
This is the ConfigRPC server component, it provides a gRpc API for retrieving partial or total configuration objects from the main value using JSON Path expressions.
service ConfigrpcService {
rpc findString( FindStringRequest ) returns ( FindStringResponse ) {}
}
message FindStringRequest{
string key = 1;
google.protobuf.StringValue jsonPath = 2;
}
message FindStringResponse{
KeyString kv = 1;
}
message KeyString {
string key = 1;
string value = 2;
}
key: /service/data
value:
{
"environments" : [
{
"environment": "TEST",
"database": {"host": "10.0.0.79", "user": "sa", "password_key": "test-db-pwd"},
"admin": "sam@svc.com"
},
{
"environment": "STAGING",
"database": {"host": "10.1.0.237", "user": "sa", "password_key": "staging-db-pwd"},
"admin": "ana@svc.com"
}
]
}
key : `/service/data`
jsonPath : `$.environments[0].database`
Returns:
{host=10.0.0.79, user=sa, password_key=test-db-pwd}
key : `/service/data`
jsonPath : `$.environments[0].database.host`
Returns:
10.0.0.79
key : `/service/data`
jsonPath : `$..admin`
Returns:
["sam@svc.com","ana@svc.com"]
Using gRPC-UI
- java 11 or newer
This server component depends on the interface submodule configrpc-api.jar
Install the dependency configrpc-api.jar
locally, see project for install details
./mvnw spring-boot:run
Note: this project uses Google protocol buffers