Chapter 16. Data Grid Modules for Red Hat JBoss EAP
To use Data Grid inside applications deployed to Red Hat JBoss EAP, you should install Data Grid modules that:
- Let you deploy applications without packaging Data Grid JAR files in your WAR or EAR file.
- Allow you to use a Data Grid version that is independent to the one bundled with Red Hat JBoss EAP.
Data Grid modules are deprecated and planned for removal. These modules provide a temporary solution until Red Hat JBoss EAP directly manages the infinispan
subsystem.
16.1. Installing Data Grid Modules
Download and install Data Grid modules for Red Hat JBoss EAP.
Prerequisites
- JDK 8 or later.
- An existing Red Hat JBoss EAP installation.
Procedure
- Log in to the Red Hat customer portal.
- Download the ZIP archive for the modules from the Data Grid software downloads.
Extract the ZIP archive and copy the contents of
modules
to themodules
directory of your Red Hat JBoss EAP installation so that you get the resulting structure:$EAP_HOME/modules/system/add-ons/rhdg/org/infinispan/rhdg-8.1
16.2. Configuring Applications to Use Data Grid Modules
After you install Data Grid modules for Red Hat JBoss EAP, configure your application to use Data Grid functionality.
Procedure
-
In your project
pom.xml
file, mark the required Data Grid dependencies as provided. -
Configure your artifact archiver to generate the appropriate
MANIFEST.MF
file.
pom.xml
<dependencies> <dependency> <groupId>org.infinispan</groupId> <artifactId>infinispan-core</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.infinispan</groupId> <artifactId>infinispan-cachestore-jdbc</artifactId> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <archive> <manifestEntries> <Dependencies>org.infinispan:rhdg-8.1 services</Dependencies> </manifestEntries> </archive> </configuration> </plugin> </plugins> </build>
Data Grid functionality is packaged as a single module, org.infinispan
, that you can add as an entry to your application’s manifest as follows:
MANIFEST.MF
Manifest-Version: 1.0 Dependencies: org.infinispan:rhdg-8.1 services