此内容没有您所选择的语言版本。
5.7. Red Hat JBoss Data Grid and Red Hat JBoss EAP
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:
For more information on tested integrations for
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).
The
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.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
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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>
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> <version>${camel.version}</version> </dependency>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
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>
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-jbossdatagrid</artifactId> <version>${jdg.version}</version> </dependency>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add in the remaining JBoss Data Grid dependencies depending on which functionality is in use:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
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
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
pom.xml
will need to have the scope
set to "provided" for any dependencies provided as modules. For example:
Download
jboss-datagrid-${jdg.version}-camel-library.zip
from Red Hat JBoss Data Grid 6.5.1 Camel Component for JBoss Fuse
.
Extract the
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
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}
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 modules user@example modules] mkdir -p org/apache/camel/core
user@example jboss-eap-6.4] cd modules user@example modules] mkdir -p org/apache/camel/core
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a
main
subdirectory to store the jars:user@example modules] mkdir org/apache/camel/core/main
user@example modules] mkdir org/apache/camel/core/main
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy over the camel-core jar from
apache-camel-${camel.version}.zip
to the newly createdmain
directory:user@example modules] cp /path/to/jboss/fuse/extras/apache-camel-${camel.version}/lib/camel-core-${camel.version}.jar ./org/apache/camel/core/main/
user@example modules] cp /path/to/jboss/fuse/extras/apache-camel-${camel.version}/lib/camel-core-${camel.version}.jar ./org/apache/camel/core/main/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the
module.xml
descriptor by adding in the following text toorg/apache/camel/core/main/module.xml
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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:user@example jboss-eap-6.4] mkdir -p modules/org/apache/camel/main
user@example jboss-eap-6.4] mkdir -p modules/org/apache/camel/main
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Unzip
jboss-datagrid-${jdg.version}-camel-library.zip
. - Copy
camel-jbossdatagrid-${jdg.version}.jar
into 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/
user@example jboss-eap-6.4] cp jboss-datagrid-${jdg.version}-camel-library/camel-jbossdatagrid-${jdg.version}.jar modules/org/apache/camel/main/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a
module.xml
descriptor by adding in the following text toorg/apache/camel/main/module.xml
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
jboss-deployment-structure.xml
in the WEB-INF
of the war, and add dependencies on the newly created module: