This repository demonstrates how to use features of Red Hat’s latest Data Grid release on JBoss EAP applications.
JBoss EAP is an open source platform for highly transactional, web-scale Java applications. JBoss EAP combines the familiar and popular Jakarta EE specifications with the latest technologies, like Eclipse MicroProfile, to modernize your applications from traditional Java EE into the new world of DevOps, cloud, containers, and microservices.
-
Jakarta EE compatible: JBoss EAP 7.4 is Jakarta EE 8 compatible implementation for both Web Profile and Full Platform specifications.
-
Managed Domain: Centralized management of multiple server instances and physical hosts, compared to a standalone server that supports just a single server instance.
-
Management console and management CLI: New domain or standalone server management interfaces. The management CLI includes a batch mode that scripts and automates management tasks.
-
Simplified directory layout: The modules directory contains application server modules.
-
Modular class-loading mechanism: Modules are loaded and unloaded on demand. This practice improves security performance and reduces startup and restart times.
-
Streamlined datasource management: Database drivers are deployed similarly to other JBoss EAP services.
-
Unified security framework: Elytron provides a single unified framework for managing and configuring access for both standalone servers and managed domains.
Find here all the documentation for the latest release of JBoss EAP.
This section explains how to install and upgrade the JBoss EAP server. The binaries are available on the RH downloads website.
-
Download the latest version of the server (Currently 7.4) and its latest patch (Currently 7.4.3).
-
Unzip the server
.zip
.cd ~/Downloads unzip jboss-eap-7.4.0.zip export EAP_HOME="/home/alvaro/Downloads/RHDG/jboss-eap-7.4/"
-
Patch the server using the following command:
$EAP_HOME/bin/jboss-cli.sh "patch apply jboss-eap-7.4.3-patch.zip"
More detailed information:
-
EAP 7.4 Doc: Installation guide.
-
EAP 7.4 Doc: Upgrading guide.
Run the server instance with the following command:
${EAP_HOME}/bin/standalone.sh -c standalone-ha.xml
${EAP_HOME}/bin/add-user.sh -u 'admin' -p 'admin'
You should see the following output:
11:43:40,187 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: JBoss EAP 7.4.3.GA (WildFly Core 15.0.6.Final-redhat-00003) started in 6477ms - Started 336 of 669 services (451 services are lazy, passive or on-demand)
11:43:40,191 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
11:43:40,192 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
More detailed information:
-
EAP 7.4 Doc: Getting started guide.
The infinispan subsystem provides caching support for JBoss EAP. It allows you to configure and view runtime metrics for named cache containers and caches. It provides value as a standard architectural component in application infrastructures for a variety of real-world scenarios and use cases:
-
Data caching and transient data storage.
-
Primary data store.
-
Low latency compute grid.
More detailed information:
-
EAP 7.4 Doc: Infinispan.
We have created a small application to test the previous mentioned features of Infinispan for JBoss EAP. It is a Java application that allows to perform CRUD operations to a cache.
In order to run the Java application, you will have to package it normally and deploy it to the JBoss EAP instance. Use the following commands:
mvn clean package
cp target/rhdg-on-eap.war $EAP_HOME/standalone/deployments
Right after copying the .war
file, you will be able to access the application on this URL http://127.0.0.1:8080/rhdg-on-eap
.
This section compiles all the ways you can run a certified Data Grid cluster as a cache and summarizes some of the pros / cons that I found:
-
Red Hat Data Grid in Client / Server mode
-
Red Hat Data Grid in Embedded mode
-
Infinispan subsystem for EAP (RHDG feature integrated with EAP server).
-
Java application running inside EAP with Data Grid in embedded mode.
Feature |
1. DG in C/S mode |
2. DG in embedded mode |
3. DG subsystem for EAP |
4. EAP app with embedded mode |
Advanced features |
Pro: Full capabilities: Metrics, Queries, Remote Code execution, etc. |
Pro: Full capabilities: Metrics, Queries, Remote Code execution, etc. |
Con: Reduced capabilities. |
Pro: Full capabilities: Metrics, Queries, Remote Code execution, etc. |
Coupling and DG upgrades |
Pro: Decouples the cache and app lifecycle. Application upgrades don’t force cached data rebalancing. RHDG upgrades don’t impact applications. |
Con: Cache and app lifecycle are coupled. Application upgrades force cached data rebalancing and upgrading Data Grid version implies restarting all the application nodes. |
Pro: Decouples the cache and app lifecycle. Application upgrades don’t force cached data rebalancing. RHDG version is managed by EAP, not the application. RHDG upgrades don’t impact applications. |
Con: Cache and app lifecycle are coupled. Application upgrades force cached data rebalancing and upgrading Data Grid version implies restarting all the application nodes. |
Restarts |
Pro: App node restarts don’t imply loosing cached data. |
Con: App node restarts imply loosing or rebalancing cached data. |
Pro: App node restarts don’t imply loosing cached data. |
Con: App node restarts imply loosing or rebalancing cached data. |
Data Access |
Pro: You can use your data from any client application, even non-Java clients. |
Con: You can only access data from the same application. |
Pro/Con: You can share your caches among all your applications deployed on that EAP cluster, but cannot expose a Hot Rod endpoint to access those caches from outside the EAP cluster. |
Con: You can only access data from the same application. |
Consumption |
Con: More Mem/CPU consumption, as you need to deploy JVMs both for app and Data Grid, and provide sufficient resources to both JVMs to avoid OutOfMemory exceptions. |
Con: Less Mem/CPU consumption as you share the JVM for both app and cache. |
Con: Less Mem/CPU consumption as you share the JVM for both app and cache. |
Con: Less Mem/CPU consumption as you share the JVM for both app and cache. |
Subscriptions |
Con: All Data Grid servers need Data Grid entitlements. |
Pro: All JVMs need Data Grid entitlements. |
Con: All EAPs need both EAP and Data Grid entitlements. |
Con: All EAPs need both EAP and Data Grid entitlements. |
Data Grid version |
Pro: Use the latest version as soon as the new version is Generally Available (GA). |
Pro: Use the latest version as soon as the new version is Generally Available (GA). |
Con: After the new DG version is released, you have to wait for the EAP team to integrate it in EAP. Check here current Data Grid bits version in EAP releases. |
Pro: Use the latest version as soon as the new version is Generally Available (GA). |
|
This section is only for EAP version < 7.4.0.GA |
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.
More detailed information:
-
EAP Documentation: Externalize HTTP Sessions to Red Hat Data Grid.
-
EAP Documentation: Storing Web Session Data In a Remote Red Hat Data Grid.
-
KCS: How to configure and tune the session replication for EAP.
-
RH Developer Blog: Integrate Red Hat Data Grid and Red Hat JBoss Enterprise Application Platform on Red Hat OpenShift