Author: Martin Gencur Level: Intermediate Technologies: Infinispan, HotRod, REST Summary: Shows how to enable Infinispan compatibility mode so that data can be read/written over different protocols. Target Product: JDG Product Versions: EAP 6.x, JDG 6.x Source: https://github.com/infinispan/jdg-quickstart
This quickstart demonstrates the behaviour of a compatibility mode. Updates of shares are being stored in a cache via HotRod client and retrieved via HTTP client over REST.
The quickstart consists of two applications: a server-side application and client-side application.
Steps needed to build and run the applications:
-
Build a server module for JBoss Data Grid Server. In this step, a class common to both clients and the server is packaged in a single jar file and placed in a directory structure similar to a server module.
mvn clean package -Pprepare-server-module
-
Install the server module into the server.
-
Copy the prepared module into the server:
cp -r target/modules ${JDG_SERVER_HOME}/
-
Add the new module as a dependency of the
org.infinispan.commons
module. I.e. add<module name="org.infinispan.quickstart.compatibility.common"/>
tomodule.xml
inmodules/system/layers/base/org/infinispan/commons/main
-
-
Build the application.
mvn clean package
-
Configure JBoss Data Grid server to use a proper configuration file.
-
Copy an example configuration file for a compatibility mode to a correct location where JBoss Data Grid server can pick it up.
cp ${JDG_SERVER_HOME}/docs/examples/configs/standalone-compatibility-mode.xml ${JDG_SERVER_HOME}/standalone/configuration
-
Disable REST security by removing
security-domain
andauth-method
attribute definitions from<rest-connector>
configuration element.
-
-
Start JBoss Data Grid server
${JDG_SERVER_HOME}/bin/standalone.sh -c standalone-compatibility-mode.xml
-
Open another terminal and start the server-side application - Market Updater
mvn exec:java
-
Open yet another terminal and start the client-side application
mvn exec:java -Pclient
-
Follow the help for the client application and try it out!