Skip to main content
AI
  • Get started with AI

    • Red Hat AI

      Accelerate the development and deployment of enterprise AI solutions.

    • AI learning hub

      Explore learning materials and tools, organized by task.

    • AI interactive demos

      Click through scenarios with Red Hat AI, including training LLMs and more.

    • AI/ML learning paths

      Expand your Red Hat OpenShift AI knowledge using these learning resources.

    • AI quickstarts

      Focused AI use cases designed for fast deployment on Red Hat AI platforms.

    • No-cost AI training

      Foundational Red Hat AI training.

  • Featured resources

    • Red Hat OpenShift AI
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

Red Hat AI Factory with NVIDIA

Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.

Learn
  • Self-guided

    • Documentation

      Find answers, get step-by-step guidance, and learn how to use Red Hat products.

    • Learning paths

      Explore curated walkthroughs for common development tasks.

    • Guided learning

      Receive custom learning paths powered by our AI assistant.

    • See all learning
  • Hands-on

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

    • Interactive labs

      Learn by doing in these hands-on, browser-based experiences.

    • Interactive demos

      Click through product features in these guided tours.

  • Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics
  • Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
Build
  • Get started

    • Red Hat build of Podman Desktop

      A downloadable, local development hub to experiment with our products and builds.

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

  • Download products

    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products
  • Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset
  • References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
Community
  • Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions
  • Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github
  • Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

Join the Red Hat Developer program

Download Red Hat products and project builds, access support documentation, learning content, and more.

ConsoleDocsSupport Search
New For you

Recommended

We'll recommend resources you may like as you browse. Try these suggestions for now.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

Build reactive apps on Kubernetes using Camel K

November 7, 2022
Sumit Mukherjee
Related topics:
KafkaKubernetesOpen sourceServerless
Related products:
Red Hat OpenShift Container Platform

A reactive application meets modern requirements for customer-facing services. Reactive applications are message-driven, elastic, responsive, and resilient. Common traits of reactive applications include:

  • An event-driven architecture
  • Data integration
  • Distributed integration
  • Function-as-a-Service (FaaS)

Events play a major role in these types of applications. Events are not new, but event-driven architectures are gaining in popularity and use asynchronous message queue technologies such as RabbitMQ, Apache ActiveMQ, WebLogic, and IBM MQ. In this article, you'll learn how Apache Camel K can make it easier to develop reactive applications on Kubernetes by integrating data sources, Apache Kafka brokers, and Knative for event management.

Why choose Camel K?

Apache Camel K is a Kubernetes-native cloud integration platform based on Apache Camel. Apache Camel is popularly known as the Swiss army knife of integration. Camel 2.x can integrate a wide range of endpoints, transform data into and out of different formats, and process data using prebuilt enterprise integration patterns.

The release of Camel 3 in 2019 introduced Camel K. This framework creates integrated, modular, lean, and fast applications and functions that are inherently reactive. Such applications and functions can run serverless on Kubernetes or Red Hat OpenShift clusters. The cluster can be hosted on a public, private, or hybrid cloud or using on-premises infrastructure.

Camel K combines the well-known Camel components and connectors with the low boot times and memory consumption of the Quarkus Java platform. Quarkus gives programmers built-in tools for making applications that are based on message forwarding and are responsive, elastic, and resilient. To interact with many types of systems, Quarkus offers these capabilities through extensions. Each new release of Quarkus adds more extensions, enabling more reactive features.

How Camel K enables reactive applications

To build a reactive application, an integration specifies the sources and destinations (sinks) of interactions. This configuration is referred to as binding in the Camel K universe. Camel K introduces the concept of Kamelets, which configure both sources and sinks. So to build a reactive application, you just need to connect a source Kamelet to a sink Kamelet.

As an example, imagine an e-commerce website that dynamically updates its masthead banner in real time with information on the ten fastest selling items. The application accomplishes this task through a microservices-based architecture with Kafka topics as the communication medium. The application couples the Kafka topic listing customer orders to an Infinispan cache that stores the names of the sold items. The web application then fetches information on sales from the Infinispan cache and updates the masthead in the client browser over WebSockets. Figure 1 shows the elements of this solution.

A basic architecture for real-time, reactive updates to a web page uses Kafka, connected through Camel K.
Figure 1: A basic architecture for real-time, reactive updates to a web page uses Kafka.

Apache Kafka is one of the most widely used platforms for event streaming. Traditionally, however, applications would have to be Kafka-integration aware and would have to orchestrate data to flow it into Kafka clusters. Alternatively, the applications would use Debezium connectors. Camel K hides the details of Kafka messaging.

Another valuable feature of Camel K is the action Kamelet, which can be illustrated through two new business demands in our example application. Suppose that an item can be listed as one of the top selling items only when the price exceeds $1,000. Additionally, to prevent unintentional disclosure of credit card numbers recorded in messages listing customer orders, the application must mask the credit card field.

An action Kamelet carries out specific activities on messages passed in by a source Kamelet. To satisfy our two new business demands, the developers create an action Kamelet that filters entries based on the price field and hides the credit card field. Figure 2 illustrates the new architecture.

The application adds a Camel K action to filter information before it goes to the web page.
Figure 2: The application adds a Camel K action to filter information before it goes to the web page.

Going serverless with KNative

Businesses are highly conscious of the costs associated with running applications in the cloud and want to get the most out of their cloud investments. A serverless computing option is one way that cloud providers today offer even more cost savings.

Camel K, in conjunction with Knative, provides reactive applications that can be automatically instantiated on source triggers and that scale to zero when no traffic is present. Furthermore, such serverless functionality is available on any cloud that can host a vanilla Kubernetes or OpenShift cluster.

Suppose you want to add the following added business requirements to our sample application:

  • If the price of an item is higher than $4,000, an email message must be sent to the purchaser for confirmation purposes.
  • Since the entire solution is reactive, the business wants to minimize compute costs caused by idle polling during periods of no activity or traffic.

Figure 3 shows a possible architecture that meets these requirements. A notable change is the use of Knative channels that decouple the source Kamelet (the Kafka topic) from the action and sink Kamelets (the Infinispan cache and email server).

The application adds Knative to manage messages.
Figure 3: The application adds Knative to manage messages.

Benefits of Camel K and Knative

The solutions illustrated by this article have the following advantages over older server technologies:

  • Portability: Camel K is a Kubernetes-native runtime, so applications can be managed as Kubernetes objects. Applications behave consistently across any platform, both in the cloud and on-premises, wherever Kubernetes or OpenShift is running.

  • Open source with no lock-in: With active contributions from the community and enterprise open source companies such as Red Hat, new and innovative features are always being added and upgraded to Camel, with no vendor lock-in.

  • Proven technology: Camel is one of the most famous integration frameworks, with industry-tested and established connectors. Camel K makes it possible for you to further modernize your application while still enjoying Camel's reliability.

  • High return on investment: Camel K helps you create integrated applications and event-driven, reactive applications and also go serverless with your enterprise processes. This all takes place within a single framework and leaves room for more.

Learn more about Camel K and Knative

The following documentation and web sites offer more background on the technologies discussed in this article.

  • Apache Camel K project website
  • Knative project website
  • Getting started with Red Hat Camel K
  • Community Kamelet catalog
  • Red Hat Kamelet catalog
  • Knative and Camel K tutorial
  • Red Hat learning path: Develop with Camel K
Last updated: October 20, 2023

Related Posts

  • Design event-driven integrations with Kamelets and Camel K

Recent Posts

  • A day in the life of an NVIDIA H100 on Red Hat OpenShift 5

  • Migrate BuildConfigs to builds for Red Hat OpenShift with one plug-in install

  • Run Red Hat Enterprise Linux CoreOS on NVIDIA BlueField DPUs

  • Agent harness engineering: Separating model capabilities from enforcement

  • What's new for developers in Red Hat Enterprise Linux 10.3 and 9.9

What’s up next?

Learn the basics of Camel K and find out how to use this lightweight framework for writing integrations.

Learn by doing
Red Hat Developers logo

Platforms

  • Red Hat AI
  • Red Hat Enterprise Linux
  • Red Hat OpenShift
  • Red Hat Ansible Automation Platform
  • See all products

Build

  • Developer Sandbox
  • Developer tools
  • Interactive tutorials
  • API catalog

Quicklinks

  • Learning resources
  • E-books
  • Cheat sheets
  • Blog
  • Events
  • Newsletter

Communicate

  • About us
  • Contact sales
  • Find a partner
  • Report a website issue
  • Site status dashboard
  • Report a security problem

Red Hat Developer

Build here. Go anywhere.

We serve the builders. The problem solvers who create careers with code.

Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

Sign me up

Red Hat legal and privacy links

  • About Red Hat
  • Jobs
  • Events
  • Locations
  • Contact Red Hat
  • Red Hat Blog
  • Inclusion at Red Hat
  • Cool Stuff Store
  • Red Hat Summit
© 2026 Red Hat

Red Hat legal and privacy links

  • Privacy statement
  • Terms of use
  • All policies and guidelines
  • Digital accessibility
Ask AI