5.7. Red Hat JBoss Data Grid and Red Hat JBoss EAP
5.7. Red Hat JBoss Data Grid and Red Hat JBoss EAP 5.7.1. Installing camel-jbossdatagrid for Red Hat JBoss Enterprise Application Platform Red Hat JBoss Enterprise Application Platform 6 (JBoss EAP 6) is a middleware platform built on open standards and compliant with the Java Enterprise Edition 6 specification. As Camel is only supported through Red Hat JBoss Fuse valid entitlements for all of the following products will be necessary: Red Hat JBoss EAP Red Hat JBoss Fuse Red Hat JBoss Data Grid Note Entitlement to Red Hat JBoss Fuse Service Works includes entitlements to Red Hat JBoss EAP and Red Hat JBoss Fuse. The following variables are used instead of specific version numbers in the installation procedures below: jdg.version - the latest version of Red Hat JBoss Data Grid fuse.version - the latest version of Red Hat JBoss Fuse infinispan.version - the version of Infinispan that is included in the latest version of Red Hat JBoss Data Grid camel.version - the version of Apache Camel that is included in the latest version of Red Hat JBoss Fuse For more information on tested integrations for 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). The camel-jbossdatagrid library is also available in a separate distribution called jboss-datagrid-USD{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 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 into C:\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 the Red 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. Report a bug 5.7.2. Deploy Camel with EAP: 5.7.2.1. Add development and runtime dependencies In order to compile your application the dependent libraries for Camel and JBoss Data Grid will have to be added to the pom.xml (if using Maven). Procedure 5.5. Add Camel from Fuse Ensure that the Fuse repository has been added to the pom.xml : Add the Camel components as a dependency in the pom.xml : 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 : Add in the remaining JBoss Data Grid dependencies depending on which functionality is in use: Report a bug 5.7.2.2. Optionally: Add runtime dependencies as a JBoss EAP Module Sometimes it is preferable to maintain other product libraries in JBoss EAP as modules. This requires some additional procedures to create these modules. Note When using modules for dependencies the pom.xml will need to have the scope set to "provided" for any dependencies provided as modules. For example: Download jboss-datagrid-USD{jdg.version}-camel-library.zip from the customer portal. Extract the apache-camel-USD{camel.version}.zip found in Red Hat JBoss Fuse's extras/ directory: Procedure 5.7. Add in the Camel components from JBoss Fuse Create a directory under USDEAP_HOME/modules: Create a main subdirectory to store the jars: Copy over the camel-core jar from apache-camel-USD{camel.version}.zip to the newly created main directory: Create the module.xml descriptor by adding in the following text to org/apache/camel/core/main/module.xml : 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 main subdirectory for the JDG Camel components: Unzip jboss-datagrid-USD{jdg.version}-camel-library.zip . Copy camel-jbossdatagrid-USD{jdg.version}.jar into the newly created directory: Create a module.xml descriptor by adding in the following text to org/apache/camel/main/module.xml : Create a jboss-deployment-structure.xml in the WEB-INF of the war, and add dependencies on the newly created module: Report a bug
<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> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> <version>USD{camel.version}</version> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-jbossdatagrid</artifactId> <version>USD{jdg.version}</version> </dependency> <!-- If Remote Camel Producer is used add the following dependency --> <dependency> <groupId>org.infinispan</groupId> <artifactId>infinispan-remote</artifactId> <version>USD{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>USD{infinispan.version}</version> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-jbossdatagrid</artifactId> <scope>provided</scope> <version>USD{jdg.version}</version> </dependency> user@example modules] unzip /path/to/jboss-fuse-USD{fuse.version}/extras/apache-camel-USD{camel.version} user@example jboss-eap-6.4] cd modules user@example modules] mkdir -p org/apache/camel/core user@example modules] mkdir org/apache/camel/core/main user@example modules] cp /path/to/jboss/fuse/extras/apache-camel-USD{camel.version}/lib/camel-core-USD{camel.version}.jar ./org/apache/camel/core/main/ <?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-USD{camel.version}.jar"/> </resources> </module> user@example jboss-eap-6.4] mkdir -p modules/org/apache/camel/main user@example jboss-eap-6.4] cp jboss-datagrid-USD{jdg.version}-camel-library/camel-jbossdatagrid-USD{jdg.version}.jar modules/org/apache/camel/main/ <?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.1" name="org.apache.camel"> <resources> <resource-root path="camel-jbossdatagrid-USD{jdg.version}.jar"/> </resources> <dependencies> <module name="org.apache.camel.core" /> </dependencies> </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.6" /> <module name="org.jgroups" slot="jdg-6.6" /> <!-- Add the following lines if Remote Client-Server mode is used --> <module name="org.infinispan.client.hotrod" slot="jdg-6.6" /> </dependencies> </deployment> </jboss-deployment-structure>