이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 11. Develop an Application for the JBoss EAP Image


11.1. Create a JBoss EAP Project Using the S2I Source Workflow

To create a Red Hat Fuse 7.3 Camel CDI with EAP project using the S2I source workflow, follow these steps:

  1. Before creating a project, add the view role to the default service account to enable clustering. Enter the following oc client commands in a shell prompt:

    oc login -u developer -p developer
    oc policy add-role-to-user view -z default
  2. Navigate to the OpenShift console in your browser (https://OPENSHIFT_IP_ADDR:8443, replace OPENSHIFT_IP_ADDR with the IP address that was displayed in the case of CDK) and log in to the console with your credentials (for example, with username developer and password, developer).
  3. In the Catalog search field, enter Red Hat Fuse 7.3 Camel CDI with EAP as the search string and select the Red Hat Fuse 7.3 Camel CDI with EAP template.

    eap image s2i source 01
  4. The Information step of the template wizard opens. Click Next.
  5. The Configuration step of the template wizard opens. From the Add to Project dropdown, select My Project.

    Note

    Alternatively, if you prefer to create a new project for this example, select Create Project from the Add to Project dropdown. A Project Name field then appears for you to fill in the name of the new project.

  6. You can accept the default values for the rest of the settings in the Configuration step. Click Create.

    Note

    If you want to modify the application code (instead of just running the quickstart as is), you would need to fork the original quickstart Git repository and fill in the appropriate values in the Git Repository URL and Git Reference fields.

  7. The Results step of the template wizard opens. Click Close.
  8. In the right-hand My Projects pane, click My Project. The Overview tab of the My Project project opens, showing the s2i-fuse73-eap-camel-cdi application.
  9. Click the arrow on the left of the s2i-fuse73-eap-camel-cdi deployment to expand and view the details of this deployment, as shown.

    eap image s2i source 02
  10. In this view, you can see the build log. If the build should fail for any reason, the build log can help you to diagnose the problem.

    eap image s2i source 03
    Note

    The build can take several minutes to complete, because a lot of dependencies must be downloaded from remote Maven repositories. To speed up build times, we recommend you deploy a Nexus server on your local network.

  11. If the build completes successfully, the pod icon shows as a blue circle with 1 pod running.

    Link to the running application
  12. To open the application, click the link that is shown above the application details, which has the form http://s2i-fuse73-eap-camel-cdi-myproject.IP_ADDRESS.nip.io/. This shows a message like the following in your browser:

    Hello world from 172.17.0.3

    You can also specify a name using the name parameter in the URL. For example, if you enter the URL, http://s2i-fuse73-eap-camel-cdi-myproject.IP_ADDRESS.nip.io/?name=jdoe, in your browser you see the response:

    Hello jdoe from 172.17.0.3
  13. Click Overview on the left-hand navigation bar to return to the overview of the applications in the My Project namespace. To shut down the running pod, click the down arrow get started s2i binary 05 beside the pod icon. When a dialog prompts you with the question Scale down deployment s2i-fuse73-eap-camel-cdi-1?, click Scale Down.
  14. (Optional) If you are using CDK, you can shut down the virtual OpenShift Server completely by returning to the shell prompt and entering the following command:

    minishift stop

11.2. Structure of the JBoss EAP Application

You can find the source code for the Red Hat Fuse 7.3 Camel CDI with EAP example at the following location:

https://github.com/wildfly-extras/wildfly-camel-examples/tree/wildfly-camel-examples-5.2.0.fuse-720021/camel-cdi

The directory structure of the Camel on EAP application is as follows:

  ├── pom.xml
  ├── README.md
  ├── configuration
  │   └── settings.xml
  └── src
      └── main
          ├── java
          │   └── org
          │       └── wildfly
          │           └── camel
          │               └── examples
          │                   └── cdi
          │                       └── camel
          │                           ├── MyRouteBuilder.java
          │                           ├── SimpleServlet.java
          │                           └── SomeBean.java
          └── webapp
              └── WEB-INF
                  └── beans.xml

Where the following files are important for developing a JBoss EAP application:

pom.xml
Includes additional dependencies.

11.3. JBoss EAP Quickstart Templates

The following S2I templates are provided for Fuse on JBoss EAP:

Table 11.1. JBoss EAP S2I Templates
NameDescription

JBoss Fuse 7.3 Camel A-MQ with EAP (eap-camel-amq-template)

Demonstrates using the camel-activemq component to connect to an AMQ message broker running in OpenShift. It is assumed that the broker is already deployed.

Red Hat Fuse 7.3 Camel CDI with EAP (eap-camel-cdi-template)

Demonstrates using the camel-cdi component to integrate CDI beans with Camel routes.

Red Hat Fuse 7.3 CXF JAX-RS with EAP (eap-camel-cxf-jaxrs-template)

Demonstrates using the camel-cxf component to produce and consume JAX-RS REST services.

Red Hat Fuse 7.3 CXF JAX-WS with EAP (eap-camel-cxf-jaxws-template)

Demonstrates using the camel-cxf component to produce and consume JAX-WS web services.

Red Hat Fuse 7.3 Camel JPA + MySQL (Ephemeral) with EAP eap-camel-jpa-template

Demonstrates how to connect a Camel application with Red Hat Fuse on EAP to a MySQL database and expose a REST API. This example creates two containers, one container to run as a MySQL server, and another running the Camel application which acts as as a client to the database.

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.