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

Process Formula 1 telemetry with Quarkus and OpenShift Streams for Apache Kafka

April 28, 2022
Paolo Patierno Tom Cooper
Related topics:
KafkaQuarkus
Related products:
Streams for Apache KafkaRed Hat OpenShift

    The race is about to start.

    The driver is focusing on the track and his adrenaline is at its peak.

    The engineers are already at their computers, ready to check that everything is working fine on the car.

    The red lights will turn on one after the other, and when they all turn off together the challenge will begin.

    One side must drive as fast as possible, choose the right line, and overtake the opponents.

    The other side must analyze the telemetry, spotting potential anomalies and providing feedback to the driver.

    Everyone has a single goal: to reach the checkered flag first.

    The time has come! Five, four, three, two, one ... go!

    A Formula 1 data-streaming infrastructure

    The story we just told plays out on every race weekend in the Formula 1 season.

    We are not lucky enough to be drivers, so let's see how the engineers on the team can exploit multiple software technologies to process telemetry data in a Java application in real time.

    During the free practices, qualifying, and race, a huge amount of data is collected by the car's sensors and sent back to the team to be analyzed. The analysis improves the car's performance, spots anomalies, and provides feedback to the driver to help them shave a few milliseconds off of each lap.

    In this article, you'll learn how to set up a complete open source stack for monitoring Formula 1 telemetry data—how to ingest the data, and how to set up dashboards that let you monitor it—with everything running in a cloud environment. Figure 1 shows Red Hat OpenShift Streams for Apache Kafka with some of the open source technologies used in this article.

    Tools and programming technologies used in this article.
    Figure 1. Tools and programming technologies used in this article.
    Figure 1: Tools and programming technologies used in this article.

    How to get telemetry data

    Unfortunately, getting access to real Formula 1 telemetry data is not easy. But we can get some simulated data as the next best thing.

    For this purpose, the F1 2021 game from Codemasters - Electronic Arts works really well. It provides telemetry data for all the cars in a race, sending that data over the UDP port (on a Microsoft Xbox, for example).

    The packet specification is open and freely available, so we developed the Formula 1 - Telemetry decoding library in Java that decodes the raw bytes to provide high-level models of all the information: drivers, car status, lap times, and lots more.

    An OpenShift-based ingestion platform

    The first step is to find a way to ingest the telemetry data with low latency, high throughput, and durable storage. We cite these requirements because, in addition to real-time processing, the engineers could also be interested in replaying the data after the race for more advanced analysis.

    A platform that can provide all these features out of the box is Apache Kafka. However, running Kafka in the cloud, particularly on Kubernetes, is not straightforward. It's better to have someone else handle the burden for you.

    This is where OpenShift Streams for Apache Kafka comes into the picture. The service is based on the open source Strimzi project from the Cloud Native Computing Foundation (CNCF). Thanks to OpenShift Streams for Apache Kafka, you can spin up a Kafka cluster in a few minutes just by using the Web user interface on the Red Hat Cloud (Figure 2) or by using the rhoas command-line interface (CLI).

    You can create and manage Kafka instances in the Red Hat console.
    Figure 2. You can create and manage Kafka instances in the Red Hat console.
    Figure 2: You can create and manage Kafka instances in the Red Hat console.

    Red Hat handles all your concerns about having the service up and running 365/24/7, so you can focus on writing cloud-native applications that use a Kafka cluster for events and data streaming. OpenShift Streams for Apache Kafka simplifies basic Kafka tasks such as creating topics, defining the service accounts with the corresponding permissions to write to and read from the topics, and monitoring the status of your Kafka cluster in terms of used storage, throughput, client connections, and bytes in movement (Figure 3).

    The Red Hat console shows metrics on Kafka instances and topics, message rates, and more.
    Figure 3. The Red Hat console shows metrics on Kafka instances and topics, message rates, and more.
    Figure 3: The Red Hat console shows metrics on Kafka instances and topics, message rates, and more.

    The Formula 1 telemetry on Red Hat OpenShift Streams for Apache Kafka GitHub repository contains all you need to automate the setup of a Kafka cluster in OpenShift Streams for Apache Kafka, together with the corresponding topics and service accounts needed for the Formula 1 applications. Just follow the steps and run some scripts. The required Kafka instance will be deployed for you.

    From ingestion to monitoring

    To complete the data ingestion part of your application, you need to move data from the UDP port, where it is coming from the Xbox, to the Kafka cluster. The Apache Camel integration framework makes this step really easy.

    Through a simple application made up of different routes, it's possible to decode the packets and send them to multiple topics (Figure 4) containing:

    • The raw packets as they come in
    • Aggregated driver data together with all the information related to car status, telemetry, motion, and lap data
    • Race events such as speed traps and best lap
    An application exposing different routes can process streams of data.
    Figure 4. An application exposing different routes can process streams of data.
    Figure 4: An application exposing different routes can process streams of data.

    Another application based on Apache Camel reads from these topics and writes the corresponding messages as data points into a time series database such as InfluxDB (Figure 5).

    Data produced by the processing applications can be stored in a database.
    Figure 5. Data produced by the processing applications can be stored in a database.
    Figure 5: Data produced by the processing applications can be stored in a database.

    The database can be a data source for Grafana dashboards that help engineers monitor all the telemetry (Figure 6).

    Grafana charts can show statistics on data flows over time.
    Figure 6. Grafana charts can show statistics on data flows over time.
    Figure 6: Grafana charts can show statistics on data flows over time.

    Real-time processing

    A data-streaming platform can go way beyond ingesting data to show on dashboards. It's really valuable for real-time processing.

    The Apache Kafka project comes with its own Kafka Streams API library that can process continuous flows of data, getting insights from it in real time and reacting accordingly.

    You can build your own Kafka Streams API pipeline by designing a so-called topology from the source node to the sink node. The pipeline can pass through multiple processing nodes that run multiple operations such as mapping, filtering, grouping, and much more (Figure 7).

    A pipeline can perform many transformations on streams of incoming data.
    Figure 7. A pipeline can perform many transformations on streams of incoming data.
    Figure 7: A pipeline can perform many transformations on streams of incoming data.

    In this specific use case, the repository provides a couple of applications as examples of real-time processing in Formula 1 (Figure 8):

    • Using the windowing feature to get the average speed of all cars in the most recent 5 seconds.
    • Getting the best overall timings in each sector of the track during the lap.
    OpenShift Streams for Apache Kafka sends data through Kafka Streams and receives results of processing.
    Figure 8. OpenShift Streams for Apache Kafka sends data through Kafka Streams and receives results of processing.
    Figure 8: OpenShift Streams for Apache Kafka sends data through Kafka Streams and receives results of processing.

    But sometimes, writing an application based on the Kafka Streams API involves a lot of boilerplate code just for configuring and starting up the application. This is where the Quarkus framework comes in. Quarkus is a Kubernetes-native Java stack with support for best-of-breed Java libraries and standards. Quarkus supports the Kafka Streams API, allowing developers to focus on writing the topology of the application while the framework takes care of running it, hiding the boilerplate code.

    To add to a developer's joy, Quarkus also provides a useful web UI showing your topology.

    At the same time, thanks to native compilation with the GraalVM compiler, Quarkus makes it possible to get the best performance possible from your Java application.

    Conclusion

    Simulated Formula 1 telemetry data provides an example of how to build a very real-time analytics pipeline by using multiple technologies, all tied together and completely open source.

    You can actually try out these applications by following the steps described in the Formula 1 - Telemetry with Apache Kafka repository, where you can find the entire codebase as well.

    If you want to know more about these technologies, feel free to join us at the Red Hat Summit 2022 on May 10-11. It's virtual and free. We will lead a session on the process in this article, Formula 1 telemetry processing using Quarkus and OpenShift Streams for Apache Kafka, and go through the process in much more detail.

    Looking forward to having you there.

    Last updated: October 6, 2023

    Related Posts

    • How to use MirrorMaker 2 with OpenShift Streams for Apache Kafka

    • Connect IoT devices with Drogue IoT and OpenShift Streams for Apache Kafka

    • Is it better to split Kafka clusters?

    • Kafka Monthly Digest: March 2022

    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

    What’s up next?

    Getting started with Kafka

    Get started learning how to develop with OpenShift Streams for Apache Kafka. In this learning path, you’ll sign up for a free Red Hat account, provision a managed Kafka instance, and connect to it using service account credentials via SSL.

    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.