1. Launch one locator and couple of servers through gfsh script:
start locator --name=locator1 --port=9551
start server --name=server1 --hostname-for-clients=localhost --server-bind-address=localhost --server-port=8581 --J=-Dgemfire.start-dev-rest-api=true --J=-Dgemfire.http-service-port=8571 --J=-Dgemfire.http-service-bind-address=localhost --classpath=/path/to/conf:/path/to/lib/* --cache-xml-file=/path/to/lib/cache.xml
start server --name=server2 --hostname-for-clients=localhost --server-bind-address=localhost --server-port=8582 --J=-Dgemfire.start-dev-rest-api=true --J=-Dgemfire.http-service-port=8572 --J=-Dgemfire.http-service-bind-address=localhost --classpath=/path/to/conf:/path/to/lib/* --cache-xml-file=/path/to/lib/cache.xml
2. Deploy the attached “
functions-1.0.v1.jar”:
deploy --jars=functions-1.0.v1.jar
3. Launch swagger by going to the following URL:
http://localhost:8581/geode/swagger-ui.html
4. Click on
region : region CRUD operations to list all the available endpoints for accessing regions.
5. Make entry to be retrieved in the next step. Go "
POST /v1/{region}" to create the following entry:
json body - {"Name1":"John"}
key - person1
onRegion - SampleCache_Test
6. Retrieve the value using deployed function. Go to
POST /v1/functions/{functionId}execute function with the following input:
json body - {"@type":"String","@value":"person1"}
functionId -ReadSampleCacheDataForKeyFunction
onRegion - SampleCache_Test
7. The response will be as follows:
[
"{\n \"Name1\" : \"John\"\n}",
null
]
The entry with be retrieved in this way.
Note: If the test is carried out on multiple VMs and servers, redundant copies will also be returned. Null’s will be returned from those nodes not containing the copies.