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

Chapter 3. Getting started with Kaoto


This section describes how to:

  • Setup a workspace in VS Code
  • Access the important commands to create your integration
  • Create your first Camel Route
  • Run your Camel Route locally
  • Get access to the source code of the Camel Route

3.1. Preparing the Workspace

Visual Studio Code requires you to create a workspace for your project to access the full functionality of the environment.

  1. If you haven’t done so yet, please open your Visual Studio Code instance. You can do that by finding the right launcher on your computer or by opening a command shell and executing code.
  2. This should leave you with a window like the one below.

    empty vscode

3.2. Executing VS Code Commands

The following procedure explains how to create and store integrations with Kaoto.

  1. Select your workspace folder which will store your project files. Go to the File menu and select the entry Open Folder. In the following screen browse to the folder you would like to use and select it.

    open folder
    Note

    Some VS Code commands require a workspace to show up and function correctly. If you haven’t set one up and opened it you should check the Section 3.1, “Preparing the Workspace” section.

  2. To access the VS Code command palette you have to press either F1 or CTRL+SHIFT+P. This will open up an entry field which you can use to filter for the commands you are interested in.
  3. In our case we are interested in the Camel related commands, so lets type Camel into the field and check the filtered results.

    Create a Camel route using YAML DSL
    camel commands

3.3. Creating first Camel Route

  1. If you followed the steps from Section 3.2, “Executing VS Code Commands” section, you should still see the filtered Camel commands. Please select now the command called Camel: Create a Camel Route using YAML DSL and hit Enter.
  2. Next you are asked to provide a name for the file to be created. Feel free to pick a name without stating a file extension (example: simpleTest) and hit Enter again.

    Note

    If the execution fails you should double check if you have installed the Camel CLI correctly. Follow the instructions outline in the section Camel CLI section.

  3. If all worked correctly you should now see your new file with the extension `.camel.yaml and the Kaoto Visual Designer should open up.

If the Kaoto editor doesn’t open check you followed the Installing Kaoto section and your file is named like filename.camel.yaml. If you named the file differently then rename it to match this naming rule.

  1. You should now see a similar screen like the one below.

    new route

3.3.1. Launching the Camel Route

  1. The Camel Route we created in the previous chapter can already be launched. Let’s try to start the Route by clicking the Run Camel Application with JBang button in the top right of the Kaoto Visual Editor.

    launch button
  2. A terminal should open up and it will show you the output of your launched Camel Route.

    launch terminal
  3. You can terminate the execution of your Camel Route at any time by selecting the terminal window and pressing CTRL+C.

3.3.2. Accessing the Source Code

You might wonder how the source of your new Camel Route looks like. While Kaoto tries relief users from the burden of working with the source code, we still allow access to it via the default Visual Studio Code Text Editor.

To access your source code you can either right click the tab labeled with the filename and then select Reopen Editor with and then choosing Text Editor.

Another way of doing that is to right-click the file in the Explorer view on the left side of the window and then similarly selecting the menu item Open With and then choosing Text Editor.

If you want to revert back to the Kaoto Editor you can follow the same steps as above but instead of Text Editor you should then select Kaoto Editor.

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

© 2024 Red Hat, Inc.