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, click the readme.md file. This opens a new tab in VS Code to display the tutorial instructions.
  4. Follow the tutorial instructions.

    Alternatively, if you do not have VS Code installed, you can manually enter the commands from deploying basic Camel K Java integration.

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, click the readme.md file. This opens a new tab in VS Code to display the tutorial instructions.
  4. Follow the tutorial instructions.

    Alternatively, if you do not have VS Code installed, you can manually enter the commands from deploying Camel K Knative integration.

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, click the readme.md file. This opens a new tab in VS Code to display the tutorial instructions.
  4. Follow the tutorial instructions.

    Alternatively, if you do not have VS Code installed, you can manually enter the commands from deploying Camel K transformations integration.

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, click the readme.md file. This opens a new tab in VS Code to display the tutorial instructions.
  4. Follow the tutorial instructions.

    Alternatively, if you do not have VS Code installed, you can manually enter the commands from deploying Camel K event stream integration.

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, click the readme.md file. This opens a new tab in VS Code to display the tutorial instructions.
  4. Follow the tutorial instructions.

    Alternatively, if you do not have VS Code installed, you can manually enter the commands from deploying Camel K API integration.

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, click the readme.md file. This opens a new tab in VS Code to display the tutorial instructions.
  4. Follow the tutorial instructions .

    Alternatively, if you do not have VS Code installed, you can manually enter the commands from deploying Camel K SaaS integration.

5.7. Deploying a Camel K JDBC integration

This tutorial demonstrates how to get started with Camel K and an SQL database via JDBC drivers. This tutorial shows how to set up an integration producing data into a Postgres database (you can use any relational database of your choice) and also how to read data from the same database.

Prerequisites

Procedure

  1. Clone the tutorial Git repository:

    $ git clone git@github.com:openshift-integration/camel-k-example-jdbc.git
  2. In VS Code, select File Open Folder camel-k-example-jdbc.
  3. In the VS Code navigation tree, click the readme.md file. This opens a new tab in VS Code to display the tutorial instructions.
  4. Follow the tutorial instructions.

    Alternatively, if you do not have VS Code installed, you can manually enter the commands from deploying Camel K JDBC integration.

5.8. Deploying a Camel K JMS integration

This tutorial demonstrates how to use JMS to connect to a message broker in order to consume and produce messages. There are two examples:

  • JMS Sink: this tutorial demonstrates how to produce a message to a JMS broker.
  • JMS Source: this tutorial demonstrates how to consume a message from a JMS broker.

Prerequisites

Procedure

  1. Clone the tutorial Git repository:

    $ git clone git@github.com:openshift-integration/camel-k-example-jms.git
  2. In VS Code, select File Open Folder camel-k-example-jms.
  3. In the VS Code navigation tree, click the readme.md file. This opens a new tab in VS Code to display the tutorial instructions.
  4. Follow the tutorial instructions.

    Alternatively, if you do not have VS Code installed, you can manually enter the commands from deploying Camel K JMS integration.

Additional resources

5.9. Deploying a Camel K Kafka integration

This tutorial demonstrates how to use Camel K with Apache Kafka. This tutorial demonstrates how to set up a Kafka Topic via Red Hat OpenShift Streams for Apache Kafka and to use it in conjunction with Camel K.

Prerequisites

Procedure

  1. Clone the tutorial Git repository:

    $ git clone git@github.com:openshift-integration/camel-k-example-kafka.git
  2. In VS Code, select File Open Folder camel-k-example-kafka.
  3. In the VS Code navigation tree, click the readme.md file. This opens a new tab in VS Code to display the tutorial instructions.
  4. Follow the tutorial instructions.

    Alternatively, if you do not have VS Code installed, you can manually enter the commands from deploying Camel K Kafka integration.

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.