此内容没有您所选择的语言版本。
15.2. Build the Football Application
The following procedure outlines the steps to build a football manager application as an example of REST, Hot Rod and memcached endpoints in Red Hat JBoss Data Grid.
Important
JBoss Data Grid does not support deploying applications, therefore this quickstart cannot be installed as a deployment.
Prerequisites
Prerequisites for this procedure are as follows:
- Obtain the most recent supported JBoss Data Grid Remote Client-Server Mode distribution files from Red Hat.
- Ensure that the JBoss Data Grid and JBoss Enterprise Application Platform Maven repositories are installed and configured. For details, see Chapter 3, Install and Use the Maven Repositories
Procedure 15.1. Build the Football Application
Add Configurations
Edit thestandalone.xml
file (located at$JDG_HOME/standalone/configuration/
) to add definitions for the datasource and infinispan subsystems.- Add the following subsystem definition for the datasource:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add the following subsystem definition for infinispan:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Note
The Hot Rod and REST endpoints use the cache namedteams
and memcached endpoint usesmemcachedCache
as a default.Disable REST Security
As a default, thestandalone.xml
configuration file protects the REST endpoint withBASIC
authentication. This quickstart cannot perform authentication, therefore the REST authentication must be disabled in the REST connector by removing thesecurity-domain
andauth-method
parameters. The resulting configuration (with REST authentication disabled) is as follows:<rest-connector virtual-server="default-host" cache-container="local" />
<rest-connector virtual-server="default-host" cache-container="local" />
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For more details about security, see the REST Authentication Chapter in JBoss Data Grid's Developer Guide.Edit the Submodule Configuration File
Each submodule (specificallyhotrod-endpoint
,rest-endpoint
andmemcached-endpoint
) contains a configuration file (located at$JDG_QUICKSTART/src/main/resources/
jdg.properties
). Modify the default values in the configuration file to set the values required for your specific JBoss Data Grid installation.Navigate to the Root Directory
Open a command line and navigate to the root directory of this quickstart.Build the Application
Use the following command to build the example application in its directory:mvn clean package
mvn clean package
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This step results in the use of Maven's shade plugin, which bundles all dependencies into a single jar file for ease of use. This file is named{PROTOCOL}-endpoint-quickstart.jar
, for examplerest-endpoint-quickstart.jar
for the REST version.Start JBoss Data Grid
Run the following script to run JBoss Data Grid:$JDG_HOME/bin/standalone.sh
$JDG_HOME/bin/standalone.sh
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the Application
Run the example application in its directory with the following command:mvn exec:java
mvn exec:java
Copy to Clipboard Copied! Toggle word wrap Toggle overflow