5.4. Red Hat JBoss Data Grid and Red Hat JBoss EAP
5.4.1. Installing camel-jbossdatagrid for Red Hat JBoss Enterprise Application Platform
- Red Hat JBoss EAP
- Red Hat JBoss Fuse
- Red Hat JBoss Data Grid
Note
jdg.version- the latest version of Red Hat JBoss Data Gridfuse.version- the latest version of Red Hat JBoss Fuseinfinispan.version- the version of Infinispan that is included in the latest version of Red Hat JBoss Data Gridcamel.version- the version of Apache Camel that is included in the latest version of Red Hat JBoss Fuse
camel-jbossdatagrid, please refer to https://access.redhat.com/articles/115883.
Procedure 5.3. Installing JBoss Data Grid
- For information about installing JBoss Data Grid, see Part II, “Download and Install Red Hat JBoss Data Grid”. Only the following JBoss Data Grid components are required to run the camel component in JBoss EAP:
- JBoss Data Grid Maven repository.
- The JBoss Data Grid Server package (to use the Hot Rod client).
camel-jbossdatagrid library is also available in a separate distribution called jboss-datagrid-${jdg.version}-camel-library.
Procedure 5.4. Installing JBoss EAP
- Before attempting to install and use Red Hat JBoss EAP ensure your system meets the minimum requirements as documented in Red Hat JBoss EAP Installation Guide.
Unpacking the Archive
Red Hat JBoss EAP is installed by unpacking an archive system on a system, as JBoss EAP is packaged as a zip file; using a suitable archive tool, unpack Red Hat JBoss EAP into a directory to which you have full access.Warning
Do not unpack the archive file into a folder that has spaces in its path name. For example, do not unpack intoC:\Documents and Settings\Greco Roman\Desktop\JBoss.Additionally, do not unpack the archive file into a folder that has any of the following special characters in its path name: #, %, ^, ".- Once the archive has been extracted JBoss EAP will have been successfully installed. For more information on installation options refer to theRed Hat JBoss EAP Installation Guide.
- If JBoss Data Grid is being used in Library mode then refer to Section 4.1, “Deploy JBoss Data Grid in JBoss EAP (Library Mode)” to ensure the necessary dependencies have been installed.
- If JBoss Data Grid is being used in Remote Client-Server mode then refer to Section 4.2, “Deploy JBoss Data Grid in JBoss EAP (Remote Client-Server Mode)” to ensure the necessary dependencies have been installed.
5.4.2. Deploy Camel with EAP:
5.4.2.1. Add development and runtime dependencies
pom.xml (if using Maven).
Procedure 5.5. Add Camel from Fuse
- Ensure that the Fuse repository has been added to the
pom.xml:<repository> <id>fusesource</id> <name>FuseSource Release Repository</name> <url>https://repo.fusesource.com/nexus/content/groups/public/</url> <snapshots> <enabled>false</enabled> </snapshots> <releases> <enabled>true</enabled> </releases> </repository> - Add the Camel components as a dependency in the
pom.xml:<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> <version>${camel.version}</version> </dependency>
Procedure 5.6. Add camel-jbossdatagrid to the deployment
- Follow the instructions in Chapter 3, Install and Use the Maven Repositories to add the maven repository.
- Add camel-jbossdatagrid as a dependency in the
pom.xml:<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-jbossdatagrid</artifactId> <version>${jdg.version}</version> </dependency> - Add in the remaining JBoss Data Grid dependencies depending on which functionality is in use:
<!-- If Remote Camel Producer is used add the following dependency --> <dependency> <groupId>org.infinispan</groupId> <artifactId>infinispan-remote</artifactId> <version>${infinispan.version}</version> </dependency> <!-- If the Local Camel Producer or Local Camel Consumer are in use add --> <!-- the following dependency --> <dependency> <groupId>org.infinispan</groupId> <artifactId>infinispan-embedded</artifactId> <version>${infinispan.version}</version> </dependency>
5.4.2.2. Optionally: Add runtime dependencies as a JBoss EAP Module
Note
pom.xml will need to have the scope set to "provided" for any dependencies provided as modules. For example:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jbossdatagrid</artifactId>
<scope>provided</scope>
<version>${jdg.version}</version>
</dependency>
jboss-datagrid-${jdg.version}-camel-library.zip from Red Hat JBoss Data Grid 6.4.0 Camel Component for JBoss Fuse.
apache-camel-${camel.version}.zip found in Red Hat JBoss Fuse's extras/ directory:
user@example modules] unzip /path/to/jboss-fuse-${fuse.version}/extras/apache-camel-${camel.version}
Procedure 5.7. Add in the Camel components from JBoss Fuse
- Create a directory under $EAP_HOME/modules:
user@example jboss-eap-6.4]
cd modulesuser@example modules]mkdir -p org/apache/camel/core - Create a
mainsubdirectory to store the jars:user@example modules]
mkdir org/apache/camel/core/main - Copy over the camel-core jar from
apache-camel-${camel.version}.zipto the newly createdmaindirectory:user@example modules]
cp /path/to/jboss/fuse/extras/apache-camel-${camel.version}/lib/camel-core-${camel.version}.jar ./org/apache/camel/core/main/ - Create the
module.xmldescriptor by adding in the following text toorg/apache/camel/core/main/module.xml:<?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.1" name="org.apache.camel.core"> <resources> <resource-root path="camel-core-${camel.version}.jar"/> </resources> </module> - Repeat the above steps to create a module for each dependency in use; note that modules may have dependencies on other modules as described in the Red Hat JBoss Administration and Configuration Guide.
Procedure 5.8. Add in Camel components from JBoss Data Grid
- Create a
mainsubdirectory for the JDG Camel components:user@example jboss-eap-6.4]
mkdir -p modules/org/apache/camel/main - Unzip
jboss-datagrid-${jdg.version}-camel-library.zip. - Copy
camel-jbossdatagrid-${jdg.version}.jarinto the newly created directory:user@example jboss-eap-6.4]
cp jboss-datagrid-${jdg.version}-camel-library/camel-jbossdatagrid-${jdg.version}.jar modules/org/apache/camel/main/ - Create a
module.xmldescriptor by adding in the following text toorg/apache/camel/main/module.xml:<?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.1" name="org.apache.camel"> <resources> <resource-root path="camel-jbossdatagrid-${jdg.version}.jar"/> </resources> <dependencies> <module name="org.apache.camel.core" /> </dependencies> </module>
jboss-deployment-structure.xml in the WEB-INF of the war, and add dependencies on the newly created module:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.apache.camel" meta-inf="import"/>
<!-- Add the following lines if Library mode is used -->
<module name="org.infinispan" slot="jdg-6.4" />
<module name="org.jgroups" slot="jdg-6.4" />
<!-- Add the following lines if Remote Client-Server mode is used -->
<module name="org.infinispan.client.hotrod" slot="jdg-6.4" />
</dependencies>
</deployment>
</jboss-deployment-structure>

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.