This is an Spring Boot based app written in Kotlin that provides the following Apache Geode features
- POST region with region key and value to put data into a region
- GET region name and key to read
- Query against Apache Geode Regions
Latest Features
- Uses pure PDX instances without dependencies on having Java Classes in CLASSPATH
- Queries PDX (select * from /region) or Core Java datatypes (select field1, field2 from /region)
- Supports region CRUD operations
- Authentication endpoint with configurable username/password
- Swagger test UI
- Uses Spring Data Geode
When starting the application you must provide the ENVironment
- spring_data_gemfire_pool_locators=host1[port],host2[port] (comma separated)
- spring_security_user_name=Authentication user
- spring_security_user_password=Authentication password
- spring_data_gemfire_name =Client Name
Example
export spring_data_gemfire_pool_locators=localhost[10334]
export spring_security_user_name=admin
export spring_security_user_password=admin
export spring_data_gemfire_name=GEODE_REST_CLIENT
Secured Apache Geode Authentication
When connecting to a Apache Geode cluster with security enabled, set the following spring properties. Note that is can be different then the spring_security_user_name/spring_security_user_password properties.
spring.data.gemfire.security.username=...
spring.data.gemfire.security.password=...
The URL http://root/region prefix exposes a REST interface to preform READ/WRITE operations on a Apache Geode region.
Put a key/value entry into a given region.
NOTE The value is expected to be a JSON string
Format
http://<root>/region/<regionName>/<key>
POST BODY
<value>
Example
HTTP POST
http://host/region/Test/hello
RESPONSE
{ "name" : "world"}
Get a region value based on a given key
Format
http://<root>/region/<regionName>/<key>
Example
HTTP GET
http://localhost:8080/region/Test/hello
RESPONSE
{ "name" : "world"}
Perform a Apache Geode http://host:port/query
- Note the select assumes the results of PdxInstances
HTTP POST
select * from /region
Appending a number the limit the number of results returned.
http://host:port/query/limitNumber
HTTP POST
http://localhost:8080/query/10
select * from /region