Apache Camel has been around for more than a decade, and you are probably familiar with the name. But you might not realize that Camel has evolved into multiple innovative solutions, some built specifically to solve the challenges of integration in a Kubernetes and cloud-native environment. Consequently, Apache Camel is still an important developer toolbox for connectivity and digital transformation.
What is Apache Camel?
Apache Camel is an open source Java integration framework, based on known enterprise integration patterns, that enables the user to quickly and easily integrate various systems consuming or producing data.
Camel has been called the “Swiss army knife” of integration, because it can be used to connect many diverse enterprise systems and applications that were not designed to communicate with each other, allowing them to seamlessly share data. Beyond connectivity, Camel also performs data transformation to ensure both message format and data type are compatible between a source and one or more target systems.
The great advantage of Apache Camel, compared to other integration technologies, is that Camel is very lightweight and portable. To put it simply, it's a small Java library you can include in a Java project.
Over the years, the Apache Camel community has innovated exciting new versions and features of Camel to maintain its proven functionality while improving the developer experience. In fact, Camel can now be utilized by a user with no previous Camel experience.
In this blog, we highlight the evolution of Apache Camel to serve cloud-native development through a series of sub projects: Apache Camel Quarkus, Apache Camel K and Kamelets.
Apache Camel Quarkus: bringing Camel into the cloud
For more than 25 years, Java has been one of the most popular programming languages, and Apache Camel has been a trusty integration solution for Java projects. In the last decade, however, application development has undergone a critical shift, as developers move away from traditional, monolithic applications to lighter and more modular applications built using the cloud and Kubernetes. Java and Camel were not originally designed for clouds or containers, so if you want to enjoy the benefits of Java and Camel in the cloud, then you must update your software development tools.
The challenge with Java in the cloud is performance, because Java has a heavy footprint, requiring significant memory and a longer time to warm up. Developers using containers look to more lightweight languages, but unfortunately those languages do not have the same high level of maturity and functionality as Java. For this reason, many developers would prefer to continue using Java.
The solution is Quarkus, a Kubernetes-native Java stack built on best-of-breed Java libraries and standards, and designed for containers and cloud deployments. Quarkus translates Java into the world of clouds and Kubernetes. In this way, Quarkus provides a pathway for Java developers to continue leveraging their existing Java knowledge and experience, as well as the same Java frameworks they have used in the past, while adding high performance and boosting developer productivity.
Quarkus was built on a container-first philosophy, meaning it is optimized for lower memory usage and faster startup times. Quarkus builds applications to consume 1/10th the memory when compared to traditional Java, and has a faster startup time — as much as 300 times faster.
What is Apache Camel Quarkus?
The Apache Camel community has followed this same path to adapt to the cloud by creating a subproject called Apache Camel Quarkus. With Quarkus as the foundation, Camel Quarkus allows Java to run in Kubernetes with lightning-fast startup speed and minimal memory utilization. Quarkus gives Apache Camel a huge performance leap, eclipsing any other cloud-based Java runtime where Camel runs.
Camel Quarkus delivers several beneficial Quarkus features as well. For example, Camel Quarkus simplifies coding when you are implementing an integration. Say you need to provide different configurations for different environments, Camel Quarkus allows you to define properties in one single configuration file to cover all environments.
In addition, Camel Quarkus provides a highly advantageous Quarkus feature: live coding mode. In this mode, code changes are automatically reflected in the running application, without requiring time-consuming recompiles. This means you can iterate and experiment without losing productivity.
Camel Quarkus makes it possible for developers to continue using all the benefits of Apache Camel in Kubernetes and cloud-native environments, while enjoying the power, speed and productivity of Quarkus.
Apache Camel K: Simplifying the use of Camel
When you use traditional Apache Camel, you are responsible for tasks such as adding sources and defining “Camel Routes” inside a Maven Java Project that includes dependency definitions in the cloud, however, developers are looking for dynamic and easy ways to define processes and integrations. This was the driver behind the development of a version of Camel more easily consumable by users with less experience in these types of complex projects.
To simplify the use of Apache Camel, make Camel accessible to a broader user base and lower the entry barrier to run integrations in Kubernetes, the Apache Camel community created Camel K. This simplified version of Camel enables users to define the integration process without the complexity of a traditional Java project.
What is Apache Camel K?
Apache Camel K is a lightweight integration framework built from Apache Camel that runs natively on Kubernetes and is specifically designed for serverless and microservice architectures. The “K” stands for Kubernetes, and Camel K is built to simplify how you connect systems in Kubernetes and Red Hat OpenShift. Camel K streamlines working with Kubernetes environments so you can get your integrations up and running in a container quickly.
One of the challenges with traditional Java projects is that the developer must make sure the dependencies and libraries are well defined, otherwise there can be dependency conflicts. Camel K provides a robotic administrator, called an “operator,” that automates these processes and solves any conflicts, so you don't have to worry about dependency management, descriptors, or any of those other details.
Camel K runs on top of Camel Quarkus and introduces abstraction layers to make Camel easier for the end-user. This enables you to write small, fast Java applications that are ideal for the cloud.
Kamelets: Integration made even simpler
To make Camel integration even simpler, the Apache Camel community took Camel K to an even higher level of abstraction by introducing Kamelets, which are simple connectors comprised of encapsulated code that serve as building blocks for your Camel K integrations.
In traditional Apache Camel, the user must map out the route of the data flow for an integration, including both high-level and low-level details, and this can be complex. Reducing this complexity in Camel K, Kamelets are predefined Camel routes, or snippets. Kamelets allow users to integrate applications and systems via a simplified interface that hides all the low level details about how those connections are implemented.
Camel K provides out of the box a catalog of pre-built Kamelets, leveraging from the 300 components Camel offers. You can also easily build your own Kamelets for your unique use cases.
What are Kamelets?
Kamelets can be used to create two kinds of connectors for integrations: “Sources” and “Sinks.” Source Kamelets consume data (from the source system) and Sink Kamelets produce data, typically sent to a remote system (the Sink). Think of Kamelets as templates that define how to move data from a source to a sink to create a data pipeline.
Kamelets really come to their own when you bind them together or to a messaging platform using Bindings. Bindings are designed for users who can define integration processes but never used Camel before. By choosing Kamelets from the catalog and defining a Binding, the integration process is automatically built and deployed. In this way, Kamelet Bindings represent an important step forward in terms of automating integration development, and broadening the audience to non-Camel users.
Apache Camel and Apache Kafka: A powerful combination for sharing data
When you think of Apache Camel, it may cause you to think of Apache Kafka, as well. There is good reason for this. Camel and Kafka are complementary tools that enable users to fully establish connectivity and messaging.
Apache Camel makes it easy to hyperconnect to a streaming platform, like Apache Kafka, to ensure fast and reliable transport of data. Camel and Kafka are not alternatives to each other, but rather both important components for sharing data in an event-driven architecture.
Apache Kafka is an open source, distributed, publish/subscribe messaging system for creating fault-tolerant, real-time data feeds. You can easily use Camel to connect applications and services directly to Kafka, enabling them to send data to other applications and services. Kamelet bindings will allow you to configure how data moves from one endpoint to another in a Kafka stream-processing framework. In fact, Camel K allows you to bind a Source/Sink Kamelet to your Kafka platform to automatically deploy and connect your integration process.
As you can see, Apache Camel is no longer the solution many remember from 10 years ago. Recent innovations from the Apache Camel community – like Camel Quarkus, Camel K and Kamelets – have transformed Camel into a dynamic set of solutions that allow Java development to continue in the world of clouds and containers. If you have not checked out Apache Camel lately, it definitely deserves another look. And now that you have seen all the options, it is up to you to choose the right Camel for your ride.
Red Hat Integration
Red Hat provides Apache Camel as a key integration framework within Red Hat Integration – including access to Camel Quarkus, Camel K and Kamelets.
Red Hat Integration also offers Apache Kafka for data stream processing and messaging.
About the author
Bruno Meseguer is a Technical Marketing Manager for Red Hat Integration Products. Before becoming a Red Hatter in 2015, he worked in the integration space for over 15 years in various industries as a developer and architect, designing and building large throughput integration platforms, combining various middleware products. As a Red Hatter applying his technical experience, he guides customers in adopting best practices and technologies and helps to raise global awareness about Red Hat integration capabilities.