Queryable Kafka Topics with Kafka Streams

Robert Schmid
Nov 30, 2018 · 10 min read

Architecture of a Kafka Streams application with state stores

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

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

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.
The final application architecture.

Conclusion

bakdata

bespoke data engineering

Robert Schmid

Written by

bakdata

bakdata

bespoke data engineering