Chapter 3. Getting started with Fuse on JBoss EAP
This chapter introduces Fuse on JBoss EAP, and explains how to install, develop, and build your first Fuse application on a JBoss EAP container.
See the following topics for details:
3.1. About Fuse on JBoss EAP
JBoss Enterprise Application Platform (EAP), based on Jakarta EE technology (previously, Java EE) from the Eclipse Foundation, was originally created to address use cases for developing enterprise applications. JBoss EAP is characterized by well-defined patterns for implementing services and standardized Java APIs (for example, for persistence, messaging, security, and so on). In recent years, this technology has evolved to be more lightweight, with the introduction of CDI for dependency injection and simplified annotations for enterprise Java beans.
Distinctive features of this container technology are:
- Particularly suited to running in standalone mode.
- Many standard services (for example, persistence, messaging, security, and so on) pre-configured and provided out-of the-box.
- Application WARs typically small and lightweight (because many dependencies are pre-installed in the container).
- Standardized, backward-compatible Java APIs.
3.2. Installing Fuse on JBoss EAP
The standard installation package for Fuse 7.8 on JBoss EAP is available for download from the Red Hat Customer Portal. It installs the standard assembly of the JBoss EAP container, and provides the full Fuse technology stack.
Prerequisites
- You must have a full-subscription account on the Red Hat Customer Portal.
- You must be logged into the customer portal.
- You must have downloaded JBoss EAP and JBoss EAP 7.3 Update 02.
- You must have downloaded Fuse on JBoss EAP.
- You must have downloaded the CodeReady Studio installer.
Procedure
Run the JBoss EAP installer from a shell prompt, as follows:
java -jar DOWNLOAD_LOCATION/jboss-eap-7.3.0-installer.jar
During installation:
- Accept the terms and conditions.
-
Choose your preferred installation path,
EAP_INSTALL
, for the JBoss EAP runtime. - Create an administrative user and make a careful note of these administrative user credentials for later.
- You can accept the default settings on the remaining screens.
-
Open a shell prompt and change directory to
EAP_INSTALL
. From the
EAP_INSTALL
directory, apply JBoss EAP 7.3 Update 02. For example:bin/jboss-cli.sh "patch apply jboss-eap-7.3.x-patch.zip"
From the
EAP_INSTALL
directory, run the Fuse on EAP installer, as follows:java -jar DOWNLOAD_LOCATION/fuse-eap-installer-7.8.0.jar
Run the CodeReady Studio installer, as follows:
java -jar DOWNLOAD_LOCATION/codereadystudio-12.16.0.GA-installer-standalone.jar
During installation:
- Accept the terms and conditions.
- Choose your preferred installation path.
- Select the Java 8 JVM.
-
At the Select Platforms and Servers step, configure the JBoss EAP runtime by clicking Add and browsing to the location of the
EAP_INSTALL
directory. - At the Select Additional Features to Install step, select Red Hat Fuse Tooling.
- CodeReady Studio starts up. When the Searching for runtimes dialog appears, click OK to create the JBoss EAP runtime.
(Optional) In order to use Apache Maven from the command line, you need to install and configure Maven.
NoteIf you are using CodeReady Studio exclusively, it is not strictly necessary to install Maven, because CodeReady Studio has Maven pre-installed and configured. However, if you plan to invoke Maven from the command line, you must perform this step.
3.3. Building your first Fuse application on JBoss EAP
This set of instructions assists you in building your first Fuse application on JBoss EAP.
Prerequisites
- You need a full-subscription account on the Red Hat Customer Portal.
- You must be logged into the customer portal.
- You must have downloaded and successfully installed Fuse on JBoss EAP.
- You must have downloaded and successfully installed the CodeReady Studio installer.
Procedure
In CodeReady Studio, create a new project, as follows:
- Select File→New→Fuse Integration Project.
-
In the Project Name field, enter
eap-camel
. - Click Next.
In the Select a Target Environment pane, choose the following settings:
- Select Standalone as the deployment platform.
-
Select Wildfly/Fuse on EAP as the runtime environment and use the Runtime (optional) dropdown menu to select the
JBoss EAP 7.x Runtime
server as the target runtime.
- After selecting the target runtime, the Camel Version is automatically selected for you and the field is grayed out.
- Click Next.
- In the Advanced Project Setup pane, select the Spring Bean - Spring DSL template.
Click Finish.
ImportantIf this is the first time you are building a Fuse project in CodeReady Studio, it will take several minutes for the wizard to finish generating the project. This is because it downloads dependencies from remote Maven repositories. Do not interrupt the wizard or close CodeReady Studio while the project is building in the background.
- If prompted to open the associated Fuse Integration perspective, click Yes.
- Wait while CodeReady Studio downloads required artifacts and builds the project in the background.
Deploy the project to the server, as follows:
-
In the Servers view (bottom right corner of the Fuse Integration perspective), if the server is not already started, select the
Red Hat JBoss EAP 7.3 Runtime
server and click the green arrow to start it. Wait until you see a message like the following in the Console view:
14:47:07,283 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: JBoss EAP 7.3.2.GA (WildFly Core 10.1.11.Final-redhat-00001) started in 3301ms - Started 314 of 576 services (369 services are lazy, passive or on-demand)
- After the server has started, switch back to the Servers view, right-click the server and select Add and Remove from the context menu.
-
In the Add and Remove dialog, select the
eap-camel
project and click Add >. - Click Finish.
-
In the Servers view (bottom right corner of the Fuse Integration perspective), if the server is not already started, select the
Verify that the project is working, as follows:
-
Browse to the following URL to access the service running in the
eap-camel
project: http://localhost:8080/camel-test-spring?name=Kermit -
The browser window should show the response
Hello Kermit
.
-
Browse to the following URL to access the service running in the
Undeploy the project, as follows:
-
In the Servers view, select the
Red Hat JBoss EAP 7.3 Runtime
server. - Right-click the server and select Add and Remove from the context menu.
-
In the Add and Remove dialog, select your
eap-camel
project and click < Remove. - Click Finish.
-
In the Servers view, select the