Suchen

Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

19.21. Apache Camel

download PDF

19.21.1. Apache Camel

Camel is an open source rules-based router developed by the Apache Project.

19.21.2. Using Apache Camel

To learn how to use Apache Camel, refer to the Red Hat JBoss Fuse Web Services and Routing with Camel CXF Guide.

19.21.3. Using Camel Routes Directly

You can deploy Camel routes directly in your user application, without needing to use SwitchYard. For example, you can deploy the Camel routes as a WAR file, fronted by a servlet or CXF.

19.21.4. Supported Camel Components

The following Apache Camel components are supported by JBoss Fuse:
  • camel-amqp
  • camel-atom
  • camel-atom
  • camel-bindy
  • camel-cdi
  • camel-cxf
  • camel-dozer
  • camel-file
  • camel-ftp
  • camel-hl7
  • camel-http
  • camel-jaxb
  • camel-jms
  • camel-jpa
  • camel-mail
  • camel-mqtt
  • camel-netty
  • camel-quartz
  • camel-rss
  • camel-sap
  • camel-saxon
  • camel-sql

19.21.5. Running Camel Examples

The Camel CXF (code first) example uses code-first to expose a web service in Camel running on JBoss EAP. It can be run using Maven.

Procedure 19.1. Task

  1. To build the example, navigate to its directory and run the following command:
    mvn clean install
  2. To run the example, deploy it in JBoss EAP by copying the camel-example-cxf-tomcat.war located in the target directory to the standalone/deployments/ folder.
    The webservice is available in http://localhost:8080/camel-example-cxf-tomcat/webservices/incident?wsdl.

19.21.6. Sample Client With Camel CXF

This is what a sample client made with Camel CXF looks like:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <ns1:reportIncident xmlns:ns1="http://incident.cxf.example.camel.apache.org/">
            <arg0>
                <details>Accounting Department</details>
                <email>johncitizen@acompany.com</email>
                <familyName>Citizen</familyName>
                <givenName>John</givenName>
                <incidentId>12345</incidentId>
                <summary>Incident</summary>
            </arg0>
        </ns1:reportIncident>
    </soap:Body>
</soap:Envelope>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <ns1:statusIncident xmlns:ns1="http://incident.cxf.example.camel.apache.org/">
            <arg0>
                <incidentId>12345</incidentId>
            </arg0>
        </ns1:statusIncident>
    </soap:Body>
</soap:Envelope>

19.21.7. Camel Servlet Without Spring Example

Procedure 19.2. Task

  1. To build the example, navigate to the Apache Tomcat directory and enter the following command:
    mvn package
  2. To deploy the example, copy the resulting .war file into Apache Tomcat's Deploy folder.
  3. To access the example, open your browser and navigate to http://localhost:8080/camel-example-servlet-tomcat-no-spring-2.10.0
Red Hat logoGithubRedditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

© 2024 Red Hat, Inc.