2. Getting Started Guide
Getting Started
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
Preparing the Workspace
Visual Studio Code requires you to create a workspace for your project to access the full functionality of the environment. 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
. This should leave you with a window like the one below.
Next we need to select our workspace folder which will store our 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.
VS Code Commands
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.
In our case we are interested in the Camel
related commands, so lets type Camel
into the field and check the filtered results.
Create your first Camel Route
If you followed the steps from the 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
. 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.
If all worked correctly you should now see your new file with the extension .camel.yaml
and the Kaoto Visual Designer should open up.
filename.camel.yaml
. If you named the file differently then rename it to match this naming rule.You should now see a similar screen like the one below.
Launch your Camel Route
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.
A terminal should open up and it will show you the output of your launched Camel Route.
You can terminate the execution of your Camel Route at any time by selecting the terminal window and pressing CTRL+C
.
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
.