kafka-streams-programming

Architect, build, and debug Kafka Streams applications across Kafka, Confluent, and WarpStream environments.

Updated Jul 7, 2026
One-click install
npx skills add https://github.com/ricardolui/gcp-custom-agent-skills --skill kafka-streams-programming-ricardolui
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kafka-streams-programming
Source: https://github.com/ricardolui/gcp-custom-agent-skills/tree/main/kafka-streams-programming
Command: npx skills add https://github.com/ricardolui/gcp-custom-agent-skills --skill kafka-streams-programming-ricardolui

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Designing, implementing, and troubleshooting Kafka Streams applications requires deep knowledge of topologies, serdes, state stores, rebalancing behavior, and environment-specific configuration. This Skill guides an AI through architecture decisions, generates complete runnable projects, and diagnoses production failures. ## Core Features & Use Cases - Topology Architecture: Translate data problems into KStream/KTable/GlobalKTable patterns with decision trees for joins, windowing, aggregations, and exactly-once semantics. - Project Generation: Produce complete Gradle or Maven projects with Avro/Protobuf/JSON Schema serdes, TopologyTestDriver tests, docker-compose, topic scripts, and production hardening (DLQ, health checks, K8s manifests). - Debugging Runbooks: Classify symptoms (startup failures, rebalancing loops, deserialization errors, state store issues, EOS transaction problems) and apply targeted fixes. - Use Case: Ask the AI to build a windowed aggregation app for Confluent Cloud, and receive a runnable project with schemas, config, tests, and verification steps — or paste a ProducerFencedException stack trace and get a root-cause diagnosis. ## Quick Start Ask the AI to build a Kafka Streams application that aggregates events from your input topic, specifying your target environment such as Apache Kafka, Confluent Cloud, or WarpStream.

Frequently Asked Questions about kafka-streams-programming

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a Kafka Streams application with Avro schemas?

Generate a Gradle project with the Avro plugin, place schemas in src/main/avro, and configure SpecificAvroSerde with your Schema Registry URL. The skill produces App.java, a testable TopologyBuilder, TopologyTestDriver tests, and scripts to create topics and run the app.

KTable vs GlobalKTable: which should I use for joins?

Use KTable when both sides are co-partitioned and the join key matches the table key. Use GlobalKTable when the lookup table is small, the join key differs from the record key, or co-partitioning is impractical — it replicates the full table to every instance.

Why is my Kafka Streams app stuck in a rebalancing loop?

Rebalancing loops usually occur when processing or state restoration exceeds max.poll.interval.ms, causing consumer eviction and repeated rebalances. Increase max.poll.interval.ms, reduce max.poll.records, add standby replicas, and use persistent volumes to avoid full state restoration.

Does Kafka Streams work with WarpStream?

Yes, but WarpStream requires client overrides: larger batch sizes, higher linger, larger fetch sizes, and zone-aware routing via client.id with a ws_az suffix. Exactly-once semantics reduce throughput significantly, so at-least-once with downstream deduplication is preferred.

What causes Unknown magic byte deserialization errors?

This error occurs when records were produced without Schema Registry, such as with a plain console producer, so the expected magic byte and schema ID header are missing. Re-produce the data using schema-aware producers like kafka-avro-console-producer.

When should I not use exactly-once semantics in Kafka Streams?

Avoid exactly_once_v2 when downstream consumers can deduplicate, since at-least-once is simpler and faster. EOS adds transaction overhead, enforces producer constraints, and on WarpStream significantly reduces throughput due to limited in-flight request concurrency.