Sign inSign up

cloudnativedata/apache-geode-config-server

By cloudnativedata

•Updated almost 5 years ago

Image
0

100K+

cloudnativedata/apache-geode-config-server repository overview

⁠Setup

Start Locator and Cache Server

start locator --name=locator
configure pdx --read-serialized=true --disk-store=DEFAULT
start server --name=server1 

Create region to store properties

create region --name=Properties --type=PARTITION_REDUNDANT_PERSISTENT

⁠Testing

curl -d '{"propertySources": [{"name" : "name", "source" : {"prop1" : "value1" } }]}' -H 'Content-Type: application/json' http://localhost:8888/environment/bank-acct-cdc-source/default/null
open http://localhost:8888/bank-acct-cdc-source/default

⁠Client Side

⁠Add the following dependency

Example: Maven

    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-config</artifactId>
    </dependency>

Example: Gradle

dependencies {
  implementation 'org.springframework.cloud:spring-cloud-starter-config'
}

⁠Configuration

Set the URL of the location of the config server in the spring client application properties

spring.cloud.config.uri=http://localhost:8888 

⁠Docker Setup

Build new image

gradle clean build :applications:geode-config-server:bootBuildImage
docker tag geode-config-server:0.0.1-SNAPSHOT cloudnativedata/apache-geode-config-server:0.0.1-SNAPSHOT 
docker login
docker push cloudnativedata/apache-geode-config-server:0.0.1-SNAPSHOT

Example development

{
  "id": "1789712772",
  "propertySources": [
    {"name" :  "application.properties",
      "source" : {
        "server.port" : 8888,
        "spring.application.name" : "geode-config-server"
        
      }
    }
  ],
  "profiles": ["profiles"],
  "name": "geode-config-server"
}

⁠Load properties with configuration

java -jar applications/geode-config-server/build/libs/geode-config-server-0.0.1-SNAPSHOT.jar  --environment.json.array='[{ "name": "geode-config-server1", "propertySources": [ {"name" :  "application.properties", "source" : { "server.port" : 8888, "spring.application.name" : "geode-config-server" } } ], "profiles": ["profiles"] }, { "name": "atm-rest-service", "propertySources": [ {"name" :  "application.properties", "source" : { "server.port" : 4002, "spring.data.gemfire.pool.locators" : "localhost[10334]" } } ], "profiles": ["default"] }, { "name": "atm-geode-sink", "propertySources": [ {"name" :  "application.properties", "source" : { "server.port" : 0, "spring.data.gemfire.pool.locators" : "localhost[10334]", "spring.rabbitmq.stream.host" : "localhost", "spring.rabbitmq.host" : "localhost", "spring.rabbitmq.username" : "guest", "spring.rabbitmq.password" : "guest", "spring.cloud.stream.bindings.atmConsumer-in-0.consumer.declareExchange" : "false" } } ], "profiles": ["default"] } ]'

⁠Key Store

keytool -genkeypair -alias changemekey -keyalg RSA \
  -dname "CN=Web Server,OU=Unit,O=Organization,L=City,S=State,C=US" \
  -keypass changeme -keystore server.jks -storepass changeme

Tag summary

Content type

Image

Digest

Size

172.2 MB

Last updated

almost 5 years ago

docker pull cloudnativedata/apache-geode-config-server:0.0.1-SNAPSHOT