Developer Materials

rapid-stock-market: Compatibility Mode example with HotRod and REST

  • Author:
  • Contributors: Tristan Tarrant
  • Published: Jun 24, 2014
  • Level: Intermediate
  • Technologies:Infinispan, HotRod, REST
  • Target Product:JDG

    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:

    1) 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
    

    2) 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"/> to module.xml in modules/system/layers/base/org/infinispan/commons/main

    3) Build the application.

    mvn clean package
    

    4) 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 and auth-method attribute definitions from <rest-connector> configuration element.

    5) Start JBoss Data Grid server

    ${JDG_SERVER_HOME}/bin/standalone.sh -c standalone-compatibility-mode.xml
    

    6) Open another terminal and start the server-side application - Market Updater

    mvn exec:java
    

    7) Open yet another terminal and start the client-side application

    mvn exec:java -Pclient
    

    8) Follow the help for the client application and try it out!

    Recent Changelog

    • Jun 24, 2014(Martin Gencur):BZ1112394 Incorrect or confusing descriptions on Quick Starts
    • Jan 15, 2014(Tristan Tarrant):ISPN 3893 Add the Rapid Stock Market quickstart from infinispan quickstarts
    Avg:
    Your Rating: