How to create a Camel integration and deploy it as a serverless service

This activity, created by Kah Hoe Lai, walks through how to create an Apache Camel integration and deploy it as a serverless service using the VS Code extension Karavan.

In the first lesson, you successfully launched an empty workspace in OpenShift Dev Spaces and executed a command inside the pod. Now it's time to install Karavan and scaffold your project.

What you need

  • A workspace in Red Hat OpenShift Dev Spaces
  • A no-cost Developer Sandbox for Red Hat OpenShift environment

What you will learn

  • How to install Karavan
  • How to use Quarkus to scaffold your project

Install the Karavan extension

  1. Choose Extensions from the menu, search for Karavan in the Extensions Marketplace, and select Install (Figure 8).
    The Karavan extension in Extensions Marketplace.
    Figure 8: The Karavan extension in Extensions Marketplace.
  2. Check and confirm the Karavan extension is enabled (Figure 9).
    Confirmation that the Karavan extension is successfully enabled.
    Figure 9: Karavan extension is Enabled.
  3. The Karavan icon should appear in the left menu bar if successfully enabled (Figure 10).
    The Karavan extension now appears in the left-hand menu.
    Figure 10: The Karavan extension now appears in the left-hand menu.

Congratulations! You have successfully configured and installed the Karavan extension.

Scaffold a new Camel project

  1. Right-click the Projects icon. Choose Karavan: Create Application (Figure 11).
    The Karavan: Create Application option from context menu.
    Figure 11: The Karavan: Create Application option from context menu.
  2. Select Quarkus for the runtime (Figure 12).
    Choose Quarkus for your runtime.
    Figure 12: Choose Quarkus for your runtime.
  3. Choose OpenShift for the deploy target (Figure 13).
    Choose OpenShift for your Deploy Target.
    Figure 13: Choose OpenShift for your deploy target.
  4. You can enter the groupId, artifactId, and version, or just leave the default value (Figure 14).
    The field to enter your project's groupId, artifactId, and version.
    Figure 14: Choose the Project groupId, artifactId, and version, or leave the default value.
  5. Once successful, you should see a new file, application.properties, inside your project workspace (Figure 15).
    The content for the application.properties file.
    Figure 15: The content for the application.properties file.

Congratulations! You have successfully defined your first Camel project. Now let's create the Camel route.

Previous resource
Launch a new workspace and execute a command inside your pod
Next resource
Create the Camel integration route and the REST API service