Modern applications, rarely coded from scratch, are formed by combining software components (known as subsystems) into a single system. This process is called integration. Typical subsystems include databases and web services. This article explains how Apache Camel and Kubernetes support easy integration of such services through Kamelets.
How Kamelets make Camel integration easy
Apache Camel is a popular open source integration framework based on known Enterprise Integration Patterns (EIPs). Camel is a complete, production-ready framework with a built-in set of patterns you can use in your integration flows. These patterns are based on design patterns and help connect different systems.
Developers build many frameworks on Apache Camel. This article focuses on Camel K, but several other frameworks exist, such as Camel Kafka and Camel Quarkus.
Camel K is a lightweight integration framework based on Apache Camel that runs natively on Kubernetes to create serverless and microservice architectures. Camel K allows you to write configuration instructions in the YAML format. The YAML file is known as a Kamelet. Any Kubernetes cluster can deploy a Kamelet as a resource.
An example of a simple Kamelet follows:
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: integration
spec:
source:
ref:
apiVersion: camel.apache.org/v1alpha1
name: aws-ddb-streams-source
kind: Kamelet
sink:
ref:
apiVersion: camel.apache.org/v1alpha1
name: pulsar-sink
kind: Kamelet
Kamelets make it easy to exploit the power of Camel K without previous knowledge of that tool. Kamelets are integration snippets with connectors, in the form of sources and sinks, that allow you to connect to external systems using a simplified interface that hides the details of a connection.
4 Advantages of Kamelets
Developers are turning to Kamelets for several reasons:
- Kamelets simplify and streamline the integration of services into Kubernetes.
- You can employ Camel's powerful integration through a Kamelet without any prior knowledge of Camel.
- Kamelets offer connectors for event-driven applications. Events are becoming increasingly important, particularly with microservices. As event-driven applications spread, many organizations and developers have begun to use Apache Kafka and Knative as the backbone for connecting all of the systems' applications.
- Kamelets make it easy to reuse code for different use cases.
3 Types of Kamelets
Kamelets are classified into three types:
- Source: Consumes data from an external system into your platform.
- Sink: Sends data to an external system or performs an action on the data.
- Action: Performs an intermediate step: For example, an action can convert an event to a PDF file before it is saved to a sink.
You can use a sink or a source to listen to or trigger several types of events, like a channel or a broker. For example, a Kafka channel can be directly connected to a JMS broker using Kamelets. In another example, the Aws-ddb-streams-source can take data from an Amazon DynamoDB database, and the pulsar-sink sink could then store this data elsewhere.
Advanced features of Kamelets
- KameletBindings provide a source and a sink as a pair.
- You can store Kamelets in a catalog, similar to a GitHub repository. Kaoto is a catalog provided by my team. Kaoto is a free, open-source tool that provides a simple integration framework based on Apache Camel, making it easier to visualize your integrations and create Kamelets.
Summary
Kamelets advanced features make it easy to utilize Camel K. You can connect to external systems using a simplified interface that hides connection details. There are many advantages to using Kamelets for application integration. Learn more by reviewing the Kaoto catalog. Feel free to comment below. We welcome your feedback.
Last updated: October 20, 2023