Once you have a robust, scalable messaging system, all you need is an easy way to process the stream of messages. Stream API provides just that. It’s a Java client library (now Scala, too) that provides higher level abstraction than producer and consumer APIs.
It makes it easy to perform:
stateless operations, such as filtering and transforming stream messages
stateful operations, such as join and aggregation over a time window
The stream API handles the serializing/deserializing of messages and maintains the state required for stateful operations.
.. With windowing it’s easy to aggregate over a time range and keep track of things like top-N words that day (not demonstrated here).