Red Hat JBoss Data Grid Online Services consists of a multiple services:
-
Caching Service - the simplest, default cache
-
Shared Memory Service - a persistent cache
The services are based on JBoss Data Grid technology and they expose various endpoints and configurations depending on the use case.
This repository has the following structure:
+- Root
+-- caching-service - This service
+-- image.yaml - Image build recipe
+-- Makefile - A set of useful scripts for development work
+-- templates - OpenShift templates for this service
+-- modules - Modules used for the image
+-- functional-tests - Full end-to-end tests with Arquillian Cube
The image.yaml
uses Python framework called Concreate to build an image. The easiest way to start the build is to invoke concreate image.yaml target
and invoke a standard Docker build from target
directory.
The Makefile
contains lots of small, useful scripts. In order to perform a full end-to-end test, invoke make test-ci
. This will spin up a local OpenShift cluster, build the image, install the template, invoke end-to-end tests and kill the cluster.
The templates
directory contains a template for Service Catalog. The easiest way to install it is to use make install-templates-in-openshift-namespace
.
The modules
directory contains modules used in image.yaml
. See Concreate documentation for more details.
The functional-tests
directory contains Arquillian Cube tests. The tests assume that there’s a running OpenShift cluster and oc
or kubectl
is already attached to it.
At first you will need a working OpenShift cluster as well as oc
client in your $PATH
. See OpenShift documentation how to achieve this.
The next step is to install the templates. Feel free to use our Makefile
or manually invoke oc create -f templates/caching-service.json -n openshift
. After this step you should see the new service in OpenShift UI.
Depending on your OpenShift version and whether the Service Catalog is turned on or off, you need to spin up a new Caching Service instance in your Project.
Once it’s done, just use a Hot Rod client (or REST) to connect to it. Below is an example:
Configuration cachingServiceClientConfiguration = new ConfigurationBuilder()
.addServer()
.host("infinispan-app-hotrod") // This service is created by the template
.port(11222) // Standard Hot Rod port
.build();
RemoteCacheManager cachingService = new RemoteCacheManager(cachingServiceClientConfiguration);
RemoteCache<String, String> defaultCache = cachingService.getCache();
defaultCache.put("test", "test"); // Start playing with the Cache
If you’re interested in our plans, visit our JIRA board.
-
Wildfly CLI guide: https://developer.jboss.org/wiki/CommandLineInterface