kafka-best-practices

Configure Kafka producers and consumers with idempotence, transactions, and offset management.

13|6|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/baekenough/second-brain --skill kafka-best-practices
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kafka-best-practices
Source: https://github.com/baekenough/second-brain/tree/main/.claude/skills/kafka-best-practices
Command: npx skills add https://github.com/baekenough/second-brain --skill kafka-best-practices

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Kafka deployments frequently face reliability, duplication, and ordering challenges at scale. This guide provides best practices to improve producer/consumer patterns, topic design, and operational wiring for robust streaming pipelines.

Core Features & Use Cases

  • Producer patterns: idempotence, transactional handling, and proper acks to prevent duplicates.
  • Consumer patterns: offset management, rebalance handling, and failure recovery.
  • Topic design: partitioning strategies, retention policies, and log compaction considerations.
  • Operational guidance: monitoring, deployment considerations, and scaling tips for streaming workloads.
  • Use Case: Build a high-throughput streaming pipeline with exactly-once semantics and reliable delivery guarantees.

Quick Start

Configure your Kafka clients and topics following these patterns to begin achieving more reliable streaming.

Frequently Asked Questions about kafka-best-practices

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

FAQPage Schema
How do I configure Kafka idempotent producers to prevent duplicate messages?

Configure Kafka idempotent producers by enabling `enable.idempotence` and proper `acks` settings to prevent duplicate messages during network retries, ensuring reliable streaming delivery exactly-once.

What is the best way to design Kafka topics for high-throughput streaming pipelines?

Design Kafka topics for high-throughput streaming by applying proper partitioning strategies, retention policies, and log compaction considerations to achieve scalable and reliable message processing.

How does Kafka transactional processing work for exactly-once semantics?

Kafka transactional processing uses transactional APIs to group producer and consumer offset commits atomically, ensuring exactly-once semantics and reliable delivery in streaming pipelines without data duplication.

Why do my Kafka consumers lose messages or read duplicates during rebalancing?

Kafka consumers lose messages or read duplicates during rebalancing due to improper offset management; applying correct offset commit patterns and rebalance handling ensures reliable failure recovery.

Do I need specific Kafka consumer configurations to handle high-throughput workloads?

Handling high-throughput Kafka workloads requires specific consumer configurations for offset management and failure recovery, alongside operational scaling tips and proper topic partitioning to maintain streaming reliability.

When should I use log compaction instead of retention policies for Kafka topics?

Use Kafka log compaction instead of standard retention policies when you need to maintain the latest state for individual message keys, whereas retention policies delete older data based on time or size limits.