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

Creating event sources in the OpenShift 4.5 web console

July 28, 2020
Brian Tannous
Related topics:
MicroservicesServerlessKubernetesEvent-driven

    Red Hat OpenShift 4.5 makes it easier than ever to deploy and run event-driven applications that react to real-time information via event notifications. Empowered by OpenShift Serverless, applications come to life through events, scaling up resources as needed (or up to a pre-configured limit), and then scaling back to zero after the resource burst is over.

    In this article, I briefly introduce the OpenShift Serverless features for developing event-driven applications in OpenShift 4.5. I also demonstrate these features with an example featuring Knative services and a Kafka event source.

    Event-driven application architecture

    Events provide a simple mechanism for applications to subscribe to a variety of event sources, including your own applications, cloud services from multiple providers, Software-as-a-Service (SaaS) systems, and Red Hat services such as AMQ Streams. The new Developer perspective in the OpenShift 4.5 web console makes it even easier to deploy event-driven applications without relying on YAML.

    Serverless eventing in OpenShift 4.5

    OpenShift Serverless provides several mechanisms for building event-driven applications:

    • Direct connections
    • Channels and subscriptions
    • Event filtering with brokers and triggers

    The best method to use depends on the needs of the service.

    Direct connections

    The most simple event-driven architecture is a direct connection. Figure 1 shows the architecture for directly connecting a Knative service to an event source. Later in the article, I will show you how to use the new OpenShift Developer perspective to create a direct connection.

    A diagram of the event-driven application architecture for a direct connection.
    Figure 1: The event-driven application architecture for a direct connection.

    Directly connecting sources to services works well, but what if you need to group multiple sources? What if multiple services need to subscribe to those groups?

    Channels and subscriptions

    Multiple sources and sinks can work together via OpenShift Serverless channels and subscriptions. Figure 2 shows the architecture of channels and subscriptions in an event-driven application.

    A diagram of the event-driven application architecture for channels and subscriptions.
    Figure 2: The event-driven application architecture for channels and subscriptions.

    Event channels make groups of event sources easy to reuse. Subscriptions offer a simple way to tie events to Knative services.

    Event brokers and triggers

    OpenShift Serverless lets us quickly group and reuse events, but what about filtering event notifications? One option would be to add a function to the application code to only process certain kinds of events. While this approach might work, it risks notifying services about events that they don't need and will just throw out. Another method is to use filtering notifications, which will only notify the service when it is necessary.

    The OpenShift Serverless event broker and trigger build on event sources to filter events before notifying the service, as shown in Figure 3.

    A diagram of the event-driven application architecture for brokers and triggers.
    Figure 3: The event-driven application architecture for brokers and triggers.

    Creating Knative services

    Since OpenShift 4.4, it has been possible to select a Knative Service resource type when adding a new application to a project. Adding a Knative Service resource type instantly allows any application to benefit from the power of OpenShift Serverless, as demonstrated in Figure 4.

    A demonstrating of creating a Knative service in OpenShift.
    Figure 4: Creating a Knative service in OpenShift.

    Binding an event source to a Knative service

    You can now use the OpenShift Developer perspective to create and bind event sources to Knative services. As demonstrated in Figure 5, you just drag the event source connector (arrow icon) out of an existing Knative service and select Event Source. Then, you configure the event source (in this case, a Kafka event source) with the event type that should trigger the application.

    A demonstration of binding a Kafka event source to a Knative service in the OpenShift Developer perspective.
    Figure 5: Binding a Kafka event source to a Knative service in the OpenShift Developer perspective.

    Notice that the OpenShift Developer perspective provides a simple slide-out so that you can quickly see all of the resources related to the newly created event source.

    Validating the event-driven application

    The last step in building an event-driven application is to validate that the service is receiving notifications. The demo in Figure 6 shows the Kafka event source using two different Kafka topics to trigger the Knative service.

    A demonstration of coding event notifications from a Kafka event source.
    Figure 6: Event notifications from a Kafka event source.

    Give us your feedback!

    A huge part of the OpenShift developer experience process is receiving feedback and collaborating with our community and customers. We'd love to hear from you. We hope you will share your thoughts on the OpenShift 4.5 Developer Experience feedback page. You can also join our OpenShift Developer Experience Google Group to participate in discussions and learn about our Office Hours sessions, where you can collaborate with us and provide feedback about your experience using the OpenShift web console.

    Get started with OpenShift 4.5

    Are you ready to get started with the new OpenShift 4.5 web console? Try OpenShift 4.5 today.

    Last updated: July 27, 2020

    Recent Posts

    • Protect data offloaded to GPU-accelerated environments with OpenShift sandboxed containers

    • Case study: Measuring energy efficiency on the x64 platform

    • How to prevent AI inference stack silent failures

    • Preventing GPU waste: A guide to JIT checkpointing with Kubeflow Trainer on OpenShift AI

    • How to manage TLS certificates used by OpenShift GitOps operator

    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.