10 The Processor API

 

This chapter covers

  • Evaluating higher-level abstractions versus more control
  • Working with sources, processors, and sinks to create a topology
  • Digging deeper into the Processor API with a stock analysis processor
  • Creating a co-grouping processor
  • Integrating the Processor API and the Kafka Streams API

We’ve been working with the high-level Kafka Streams API until this point in the book. A DSL allows developers to create robust applications with minimal code. The ability to quickly assemble processing topologies is an essential feature of the Kafka Streams DSL. It will enable you to iterate rapidly to flesh out ideas for working on your data without getting bogged down in the intricate setup details some other frameworks may need.

But at some point, even when working with the best tools, you’ll come up against one of those one-off situations—a problem that requires you to deviate from the traditional path. Whatever the case, you need a way to dig down and write some code that isn’t possible with a higher-level abstraction.

10.1 Working with sources, processors, and sinks to create a topology

10.1.1 Adding a source node

10.1.2 Adding a processor node

10.1.3 Adding a sink node

10.2 Digging deeper into the Processor API with a stock analysis processor

10.2.1 The stock-performance processor application

10.2.2 Punctuation semantics

10.2.3 The process() method

10.2.4 The punctuator execution

10.3 Data-driven aggregation

10.4 Integrating the Processor API and the Kafka Streams API

Summary