Skip to main content
Redhat Developers  Logo
  • 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 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

    • OpenShift AI learning
    • 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.
    • Explore the solution
  • 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

    • Access product downloads to start building and testing right away.
    • 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.
    • Explore the benefits

How Knative broker GA enhances Kafka on OpenShift Serverless

November 15, 2022
Matthias Wessendorf
Related topics:
KafkaServerless
Related products:
Red Hat OpenShift Serverless

    Apache Kafka is greatly enhanced by the Knative broker, which reduces overhead for message delivery.  Red Hat OpenShift has its own Knative implementation, introduced as a Tech Preview earlier this year. Our Knative implementation has reached General Availability now with the 1.25 release of Red Hat Openshift Serverless.

    How Knative enhances Kafka message delivery

    Knative is integrated with Apache Kafka as an optimized, native broker that stores and routes events to interested consumers. The incoming cloud events are directly stored on a configurable Kafka topic and read from the same topic for message delivery when the messages are routed to a registered subscriber using a Trigger API. Integrating the broker and its trigger APIs directly into Apache Kafka has enormous benefits over other, channel-based broker types. Knative reduces extra network traffic because you won't need further HTTP communications to and from an underlying channel.

    Other benefits of the Kafka broker implementation include:

    • At-least-once delivery guarantees
    • Ordered delivery of events based on the CloudEvents partitioning extension
    • High availability for the control plane
    • A horizontally scalable data plane

    How to use the Knative Kafka broker

    You can use Knative on OpenShift Serverless by getting a Red Hat AMQ streams instance up and running, and configuring it for proper access in the Openshift Serverless Operator. For details about the configuration, please refer to the documentation.

    After you have completed the configuration, you can use Kafka by specifying the broker.class annotation metadata on the broker's metadata field as follows:

    apiVersion: eventing.knative.dev/v1
    kind: Broker
    metadata:
      annotations:
        eventing.knative.dev/broker.class: Kafka
      name: example-kafka-broker
    spec:
      config:
        apiVersion: v1
        kind: ConfigMap
        name: kafka-broker-config
        namespace: knative-eventing

    Now you can wire your Knative event sources to the broker object and use the Trigger APIs to route the cloud event messages to their final destinations by entering:

    apiVersion: eventing.knative.dev/v1
    kind: Trigger
    metadata:
     name: simple-trigger
    spec:
     broker: example-kafka-broker
     subscriber:
       ref:
         apiVersion: v1
         kind: Service
         name: receiversender

    Components of the OpenShift Kafka-based Knative broker

    In Kafka on OpenShift, the data plane consists of two generic components:

    1. A receiver for the ingress of the CloudEvents into the broker.
    2. A dispatcher for the egress of the CloudEvents out of the broker, using the Trigger API.

    The control plane manages the data plane, which is represented by the Kafka-controller and its webhook controller.

    It is important to note that the dispatcher and receiver components are reused on other Kafka-based Knative parts, including our KafkaChannel (receiver and dispatcher), KafkaSource (dispatcher), and KafkaSink (receiver). This reuse improves the quality of all our components and ensures a common code path for the ingress and egress of cloud events.

    What's Next?

    Now that Knative is integrated conveniently with OpenShift, you can speed up your data processing and analytics with a simple configuration. Please comment below if you have any questions. We welcome your feedback. In the meantime, you can practice in the Developer Sandbox for Red Hat OpenShift for free.

    Last updated: October 25, 2024

    Related Posts

    • Serverless and Knative: Installation through Deployment

    • Consuming messages from closest replicas in Apache Kafka 2.4.0 and AMQ Streams

    • HTTP-based Kafka messaging with Red Hat AMQ Streams

    Recent Posts

    • Tekton joins the CNCF as an incubating project

    • Federated identity across the hybrid cloud using zero trust workload identity manager

    • Confidential virtual machine storage attack scenarios

    • Introducing virtualization platform autopilot

    • Integrate zero trust workload identity manager with Red Hat OpenShift GitOps

    What’s up next?

    kafka pizza

    Learn how to use Kafka in your app without installing it! Follow this step-by-step experience for using Red Hat OpenShift Streams for Apache Kafka from code running in a different cluster on the Developer Sandbox for Red Hat OpenShift. You will run your code for this fun pizza stock application in the cloud, as you discover the attractions of distributed computing.

    Learn by doing
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    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

    Chat Support

    Please log in with your Red Hat account to access chat support.