Filter and map operations
📖 Scenario: You are working with a stream of messages representing orders in a Kafka topic. Each message contains an order ID and the order amount. You want to process this stream to find only the orders with amounts greater than 100 and then create a new stream with just the order IDs of these large orders.
🎯 Goal: Build a Kafka Streams application that filters orders with amounts greater than 100 and maps them to their order IDs.
📋 What You'll Learn
Create a KStream named
orders with sample order dataCreate a variable
threshold set to 100Use
filter on orders to keep only orders with amount greater than thresholdUse
map to transform filtered orders to just their order IDsPrint the resulting stream to the console
💡 Why This Matters
🌍 Real World
Filtering and mapping streams is common in real-time data processing, such as monitoring orders, transactions, or sensor data.
💼 Career
Kafka Streams skills are valuable for backend developers, data engineers, and anyone working with real-time data pipelines.
Progress0 / 4 steps