Chapter 5. Camel K quick start developer tutorials


Red Hat Integration - Camel K provides quick start developer tutorials based on integration use cases available from https://github.com/openshift-integration. This chapter provides details on how to set up and deploy the following tutorials:

5.1. Deploying a basic Camel K Java integration

This tutorial demonstrates how to run a simple Java integration in the cloud on OpenShift, apply configuration and routing to an integration, and run an integration as a Kubernetes CronJob.

Prerequisites

Procedure

  1. Clone the tutorial Git repository:

    $ git clone git@github.com:openshift-integration/camel-k-example-basic.git
  2. In VS Code, select File Open Folder camel-k-example-basic.
  3. In the VS Code navigation tree, right-click the readme.didact.md file and select Didact: Start Didact Tutorial from File. For example:

    Starting the Camel K Quickstart tutorial

    This opens a new Didact tab in VS Code to display the tutorial instructions.

  4. Follow the tutorial instructions and click the provided links to run the commands automatically.

    Alternatively, if you do not have VS Code installed with the Didact extension, you can manually enter the commands from https://github.com/openshift-integration/camel-k-example-basic.

5.2. Deploying a Camel K Serverless integration with Knative

This tutorial demonstrates how to deploy Camel K integrations with OpenShift Serverless in an event-driven architecture. This tutorial uses a Knative Eventing broker to communicate using an event publish-subscribe pattern in a Bitcoin trading demonstration.

This tutorial also shows how to use Camel K integrations to connect to a Knative event mesh with multiple external systems. The Camel K integrations also use Knative Serving to automatically scale up and down to zero as needed.

Prerequisites

Procedure

  1. Clone the tutorial Git repository:

    $ git clone git@github.com:openshift-integration/camel-k-example-knative.git
  2. In VS Code, select File Open Folder camel-k-example-knative.
  3. In the VS Code navigation tree, right-click the readme.didact.md file and select Didact: Start Didact Tutorial from File. This opens a new Didact tab in VS Code to display the tutorial instructions.
  4. Follow the tutorial instructions and click the provided links to run the commands automatically.

    Alternatively, if you do not have VS Code installed with the Didact extension, you can manually enter the commands from https://github.com/openshift-integration/camel-k-example-knative.

5.3. Deploying a Camel K transformations integration

This tutorial demonstrates how to run a Camel K Java integration on OpenShift that transforms data such as XML to JSON, and stores it in a database such as PostgreSQL.

The tutorial example uses a CSV file to query an XML API and uses the data collected to build a valid GeoJSON file, which is stored in a PostgreSQL database.

Prerequisites

Procedure

  1. Clone the tutorial Git repository:

    $ git clone git@github.com:openshift-integration/camel-k-example-transformations.git
  2. In VS Code, select File Open Folder camel-k-example-transformations.
  3. In the VS Code navigation tree, right-click the readme.didact.md file and select Didact: Start Didact Tutorial from File. This opens a new Didact tab in VS Code to display the tutorial instructions.
  4. Follow the tutorial instructions and click the provided links to run the commands automatically.

    Alternatively, if you do not have VS Code installed with the Didact extension, you can manually enter the commands from https://github.com/openshift-integration/camel-k-example-transformations.

5.4. Deploying a Camel K Serverless event streaming integration

This tutorial demonstrates using Camel K and OpenShift Serverless with Knative Eventing for an event-driven architecture.

The tutorial shows how to install Camel K and Serverless with Knative in an AMQ Streams cluster with an AMQ Broker cluster, and how to deploy an event streaming project to run a global hazard alert demonstration application.

Prerequisites

Procedure

  1. Clone the tutorial Git repository:

    $ git clone git@github.com:openshift-integration/camel-k-example-event-streaming.git
  2. In VS Code, select File Open Folder camel-k-example-event-streaming.
  3. In the VS Code navigation tree, right-click the readme.didact.md file and select Didact: Start Didact Tutorial from File. This opens a new Didact tab in VS Code to display the tutorial instructions.
  4. Follow the tutorial instructions and click the provided links to run the commands automatically.

    Alternatively, if you do not have VS Code installed with the Didact extension, you can manually enter the commands from https://github.com/openshift-integration/camel-k-example-event-streaming.

5.5. Deploying a Camel K Serverless API-based integration

This tutorial demonstrates using Camel K and OpenShift Serverless with Knative Serving for an API-based integration, and managing an API with 3scale API Management on OpenShift.

The tutorial shows how to configure Amazon S3-based storage, design an OpenAPI definition, and run an integration that calls the demonstration API endpoints.

Prerequisites

Procedure

  1. Clone the tutorial Git repository:

    $ git clone git@github.com:openshift-integration/camel-k-example-api.git
  2. In VS Code, select File Open Folder camel-k-example-api.
  3. In the VS Code navigation tree, right-click the readme.didact.md file and select Didact: Start Didact Tutorial from File. This opens a new Didact tab in VS Code to display the tutorial instructions.
  4. Follow the tutorial instructions and click the provided links to run the commands automatically.

    Alternatively, if you do not have VS Code installed with the Didact extension, you can manually enter the commands from https://github.com/openshift-integration/camel-k-example-api.

5.6. Deploying a Camel K SaaS integration

This tutorial demonstrates how to run a Camel K Java integration on OpenShift that connects two widely-used Software as a Service (SaaS) providers.

The tutorial example shows how to integrate the Salesforce and ServiceNow SaaS providers using REST-based Camel components. In this simple example, each new Salesforce Case is copied to a corresponding ServiceNow Incident that includes the Salesforce Case Number.

Prerequisites

Procedure

  1. Clone the tutorial Git repository:

    $ git clone git@github.com:openshift-integration/camel-k-example-saas.git
  2. In VS Code, select File Open Folder camel-k-example-saas.
  3. In the VS Code navigation tree, right-click the readme.didact.md file and select Didact: Start Didact Tutorial from File. This opens a new Didact tab in VS Code to display the tutorial instructions.
  4. Follow the tutorial instructions and click the provided links to run the commands automatically.

    Alternatively, if you do not have VS Code installed with the Didact extension, you can manually enter the commands from https://github.com/openshift-integration/camel-k-example-saas.

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.