Queryable Kafka Topics with Kafka Streams

Robert Schmid
Nov 30, 2018 · 10 min read

Architecture of a Kafka Streams application with state stores

Image for post
Image for post
The Kafka Stream Processors responsible for the Partitions 4 to 9 are left out in this illustration. The dashed arrows indicate that new messages in a partition are also propagated to additional stream processors and their state stores, allowing for a fast fail-over if the primarily assigned processor should fail.

Adding a REST endpoint to stream processors

Image for post
Image for post
An HTTP client can send lookup requests to any of the REST endpoints of the stream processors. The dashed arrow indicates how a request is internally forwarded among the stream processors, if it cannot be answered from a local state store.

Ensuring scalability of the application

Image for post
Image for post
A suitable stream partitioning scheme ensures a well-balanced load on the State Stores. Photo Credit: Unsplash

Building the Kafka Streams application

Creating a REST service for the state store

Selecting the right processor in the load balancer

The ProcessorInfo class has Lombok annotations for automatic serialized.
Image for post
Image for post
The final application architecture.



bespoke data engineering

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store