此内容没有您所选择的语言版本。
Chapter 17. The Rapid Stock Market Quickstart
The Rapid Stock Market quickstart demonstrates how JBoss Data Grid's compatibility mode works with a Hot Rod client (to store data) and a HTTP client using REST (to retrieve data). This quickstart is only available in JBoss Data Grid's Remote Client-Server mode and does not use any containers.
The Rapid Stock Market quickstart includes a server-side and a client-side application.
17.1. Build and Run the Rapid Stock Market Quickstart 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
The Rapid Stock Market quickstart requires the following configuration for the server and client sides of the application.
Procedure 17.1. Rapid Stock Market Quickstart Server-side Configuration
Navigate to the Root Directory
Open a command line and navigate to the root directory of this quickstart.- Build a server module for the JBoss Data Grid Server by packaging a class that is common for the client and server in a jar file:
mvn clean package -Pprepare-server-module
$ mvn clean package -Pprepare-server-moduleCopy to Clipboard Copied! Toggle word wrap Toggle overflow Place the new jar file in a directory structure that is similar to the server module. - Install the server module into the server.
- Copy the prepared module to the server:
cp -r target/modules ${JDG_SERVER_HOME}/$ cp -r target/modules ${JDG_SERVER_HOME}/Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add the new module as a dependency of the
org.infinispan.commonsmodule by adding the following into themodules/system/layers/base/org/infinispan/commons/main/module.xmlfile:<module name="org.infinispan.quickstart.compatibility.common"/>
<module name="org.infinispan.quickstart.compatibility.common"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Build the application:
mvn clean package
$ mvn clean packageCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Configure the JBoss Data Grid to use the appropriate configuration file.
- Copy the example configuration file for compatibility mode to a location where the JBoss Data Grid Server can locate and use it:
cp ${JDG_SERVER_HOME}/docs/examples/configs/standalone-compatibility-mode.xml ${JDG_SERVER_HOME}/standalone/configuration$ cp ${JDG_SERVER_HOME}/docs/examples/configs/standalone-compatibility-mode.xml ${JDG_SERVER_HOME}/standalone/configurationCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the
security-domainandauth-methodattributes from therest-connectorelement to disable REST security.
- Start the JBoss Data Grid Server in compatibility mode:
${JDG_SERVER_HOME}/bin/standalone.sh -c standalone-compatibility-mode.xml$ ${JDG_SERVER_HOME}/bin/standalone.sh -c standalone-compatibility-mode.xmlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 17.2. Rapid Stock Market Quickstart Client-side Configuration
- In a new command line terminal window, start the client-side application:
mvn exec:java -Pclient
$ mvn exec:java -PclientCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Use the instructions in the help menu for the client application.