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:
- Section 5.1, “Deploying a basic Camel K Java integration”
- Section 5.2, “Deploying a Camel K Serverless integration with Knative”
- Section 5.3, “Deploying a Camel K transformations integration”
- Section 5.4, “Deploying a Camel K Serverless event streaming integration”
- Section 5.5, “Deploying a Camel K Serverless API-based integration”
- Section 5.6, “Deploying a Camel K SaaS integration”
- Section 5.7, “Deploying a Camel K JDBC integration”
- Section 5.8, “Deploying a Camel K JMS integration”
- Section 5.9, “Deploying a Camel K Kafka integration”
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
- See the tutorial readme in GitHub: https://github.com/openshift-integration/camel-k-example-basic/tree/1.6.x.
-
You must have installed the Camel K operator and the
kamel
CLI. See Installing Camel K. - Visual Studio (VS) Code is optional but recommended for the best developer experience. See link:Setting up your Camel K development environment.
Procedure
Clone the tutorial Git repository:
$ git clone git@github.com:openshift-integration/camel-k-example-basic.git
-
In VS Code, select File
Open Folder camel-k-example-basic. In the VS Code navigation tree, right-click the
readme.didact.md
file and select Didact: Start Didact Tutorial from File. For example:This opens a new Didact tab in VS Code to display the tutorial instructions.
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.
Additional resources
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
- See the tutorial readme in GitHub: https://github.com/openshift-integration/camel-k-example-knative/tree/1.6.x.
You must have cluster administrator access to an OpenShift cluster to install Camel K and OpenShift Serverless:
- Visual Studio (VS) Code is optional but recommended for the best developer experience. See Setting up your Camel K development environment.
Procedure
Clone the tutorial Git repository:
$ git clone git@github.com:openshift-integration/camel-k-example-knative.git
-
In VS Code, select File
Open Folder camel-k-example-knative. -
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. 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.
Additional resources
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
- See the tutorial readme in GitHub: https://github.com/openshift-integration/camel-k-example-transformations/tree/1.6.x.
- You must have cluster administrator access to an OpenShift cluster to install Camel K. See Installing Camel K.
- You must follow the instructions in the tutorial readme to install the PostgreSQL Operator by Dev4Ddevs.com, which is required on your OpenShift cluster
- Visual Studio (VS) Code is optional but recommended for the best developer experience. See Setting up your Camel K development environment.
Procedure
Clone the tutorial Git repository:
$ git clone git@github.com:openshift-integration/camel-k-example-transformations.git
-
In VS Code, select File
Open Folder camel-k-example-transformations. -
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. 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.
Additional resources
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
- See the tutorial readme in GitHub: https://github.com/openshift-integration/camel-k-example-event-streaming/tree/1.6.x.
You must have cluster administrator access to an OpenShift cluster to install Camel K and OpenShift Serverless:
You must follow the instructions in the tutorial readme to install the additional required Operators on your OpenShift cluster:
- AMQ Streams Operator
- AMQ Broker Operator
- Visual Studio (VS) Code is optional but recommended for the best developer experience. See Setting up your Camel K development environment.
Procedure
Clone the tutorial Git repository:
$ git clone git@github.com:openshift-integration/camel-k-example-event-streaming.git
-
In VS Code, select File
Open Folder camel-k-example-event-streaming. -
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. 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.
Additional resources
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
- See the tutorial readme in GitHub: https://github.com/openshift-integration/camel-k-example-api/tree/1.6.x.
You must have cluster administrator access to an OpenShift cluster to install Camel K and OpenShift Serverless:
- You can also install the optional Red Hat Integration - 3scale Operator on your OpenShift system to manage the API. See Deploying 3scale using the Operator.
- Visual Studio (VS) Code is optional but recommended for the best developer experience. See Setting up your Camel K development environment.
Procedure
Clone the tutorial Git repository:
$ git clone git@github.com:openshift-integration/camel-k-example-api.git
-
In VS Code, select File
Open Folder camel-k-example-api. -
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. 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.
Additional resources
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
- See the tutorial readme in GitHub: https://github.com/openshift-integration/camel-k-example-saas/tree/1.6.x.
- You must have cluster administrator access to an OpenShift cluster to install Camel K. See Installing Camel K.
- You must have Salesforce login credentials and ServiceNow login credentials.
- Visual Studio (VS) Code is optional but recommended for the best developer experience. See Setting up your Camel K development environment.
Procedure
Clone the tutorial Git repository:
$ git clone git@github.com:openshift-integration/camel-k-example-saas.git
-
In VS Code, select File
Open Folder camel-k-example-saas. -
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. 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.
Additional resources
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
- See the tutorial readme in GitHub: https://github.com/openshift-integration/camel-k-example-jdbc/tree/1.6.x.
You must have cluster administrator access to an OpenShift cluster to install Camel K.
- Visual Studio (VS) Code is optional but recommended for the best developer experience. See Setting up your Camel K development environment.
Procedure
Clone the tutorial Git repository:
$ git clone git@github.com:openshift-integration/camel-k-example-jdbc.git
-
In VS Code, select File
Open Folder camel-k-example-jdbc. -
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. 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-jdbc.
Additional resources
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
- See the tutorial readme in GitHub: https://github.com/openshift-integration/camel-k-example-jms/tree/1.6.x.
You must have cluster administrator access to an OpenShift cluster to install Camel K.
- Visual Studio (VS) Code is optional but recommended for the best developer experience. See Setting up your Camel K development environment.
Procedure
Clone the tutorial Git repository:
$ git clone git@github.com:openshift-integration/camel-k-example-jms.git
-
In VS Code, select File
Open Folder camel-k-example-jms. -
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. 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-jms.
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
- See the tutorial readme in GitHub: https://github.com/openshift-integration/camel-k-example-kafka/tree/1.6.x.
You must have cluster administrator access to an OpenShift cluster to install Camel K.
- Visual Studio (VS) Code is optional but recommended for the best developer experience. See Setting up your Camel K development environment.
Procedure
Clone the tutorial Git repository:
$ git clone git@github.com:openshift-integration/camel-k-example-kafka.git
-
In VS Code, select File
Open Folder camel-k-example-kafka. -
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. 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-kafka.