このコンテンツは選択した言語では利用できません。

Chapter 3. To Run a Route


This tutorial walks you through the process of running a route.

Goals

In this tutorial you will:

  • Run a route as a Local Camel Context (without tests)
  • Send messages through the route
  • Examine the messages received by the endpoints

Prerequisites

To complete this tutorial you will need the CBRroute project created in Chapter 2, To Create a New Route.

Running the route

To run the route:

  1. Open the CBRroute project you created in the section called “Creating the Fuse Integration project”.
  2. In Project Explorer, select CBRroute/Camel Contexts/src/main/resources/OSGi-INF/blueprint/blueprint.xml :

  3. Right-click it to open the context menu, then select menu:Run As[ > > Local Camel Context (without tests) > ].

    Note

    If you select Local Camel Context instead, the tooling automatically tries to run the routing context against a supplied JUnit test. Because one does not exist, the tooling reverts to running the routing context without tests. In the Chapter 8, To Test a Route with JUnit tutorial, you will create a JUnit test case and modify it specifically for testing the CBRroute project.

    The Console panel opens to display log messages that reflect the progress of the project’s execution. At the beginning, Maven downloads the resources necessary to update the local Maven repository, which may take a few minutes.

    Messages similar to the following at the end of the output indicate that the route executed successfully:

    ...
    [Blueprint Extender: 3] BlueprintCamelContext INFO  Route: _route1 started and consuming from:Endpoint[file://src/data?noop=true]
    [Blueprint Extender: 3] BlueprintCamelContext INFO  Total 1 routes, of which 1 are started.
    [Blueprint Extender: 1] BlueprintCamelContext INFO  Apache Camel 2.18.0.redhat-000015 (CamelContext: ...) started in 0.163 seconds
    [Blueprint Extender: 3] BlueprintCamelContext INFO  Apache Camel 2.18.0.redhat-000015 (CamelContext: ...) started in 0.918 seconds
    Copy to Clipboard Toggle word wrap
  4. To shutdown the route, click console’s shutdown button located at the top, right of the Console panel.

Verifying the route

To verify that the route executed properly:

  1. In Project Explorer, select CBRroute.
  2. Right-click it to open the context menu, then select Refresh.
  3. In Project Explorer, locate the folder target/messages/ and expand it:

  4. Verify that the target/messages/others folder contains the six message files, message1.xml through message6.xml.
  5. Double-click message1.xml to open it in the route editor’s Design tab, then select the Source tab at the bottom, left of the canvas to see the XML code.

    Its contents should match that shown in Example 3.1, “Contents of message1.xml”.

    Example 3.1. Contents of message1.xml

    <?xml version="1.0" encoding="UTF-8"?>
    
    <order>
      <customer>
        <name>Brooklyn Zoo</name>
        <city>Brooklyn</city>
        <country>USA</country>
      </customer>
      <orderline>
        <animal>wombat</animal>
        <quantity>15</quantity>
        <maxAllowed>25</maxAllowed>
      </orderline>
    </order>
    Copy to Clipboard Toggle word wrap

Further reading

To learn more about:

トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat