This is the implementation of a GreenVulcano VCL Adapter for the Redis database.
You need to install the GreenVulcano engine on the Apache Karaf container. Please refer to this link for further reference.
In order to install the bundle in Apache Karaf to use it for a GreenVulcano application project, you need to install its dependencies. Open the Apache Karaf terminal by running the Karaf executable and type the following command:
bundle:install -s -l 81 mvn:redis.clients/jedis/3.3.0
Having done that, use the list
command to make sure bundle are in Active
status.
Then, you need to install the VCL adapter bundle itself in Apache Karaf.
Clone or download this repository on your computer, and then run mvn install
in its root folder.
Then, run this command in the karaf shell to install the actual extension:
bundle:install -s -l 96 mvn:<PATH_PROJECT>/target/gvvcl-redis-<VERSION>.jar
Here's an example:
<redis-call name="test" endpoint="localhost" as-json="true" type="call">
<Set type="redisOperation" key="number" value="0"/>
<Set type="redisOperation" key="testKey" value="testValue"/>
<Set type="redisOperation" key="testKey1" value="testValue1"/>
<Set type="redisOperation" key="testKey2" value="testValue2"/>
<Set type="redisOperation" key="testKey2" value="testValue2" append="true"/>
<Get type="redisOperation" key="testKey"/>
<Delete type="redisOperation" keys="testKey"/>
<Keys type="redisOperation" pattern="testKey*"/>
<Sum type="redisOperation" key="number" number="2"/>
<Sum type="redisOperation" key="number" number="-1"/>
<Increment type="redisOperation" key="number"/>
<Decrement type="redisOperation" key="number"/>
<Get type="redisOperation" key="number"/>
</redis-call>
With Placeholders:
- redisGET{{endpoint::key}}
- redisINCR{{endpoint::key}}
- redisDECR{{endpoint::key}}
- redisSUM{{endpoint::key::num}}