
Kafka
- 53 installs
- 6 repo stars
- Updated March 13, 2026
- alphaonedev/openclaw-graph
kafka is a Claude skill that teaches an agent to operate Apache Kafka for real-time data pipelines, covering topics, partitions, consumer groups, and the producer/consumer APIs.
About
This skill is a reference card that teaches an AI agent how to work with Apache Kafka, a distributed event streaming platform for real-time data pipelines. It documents topics, partitions, consumer groups, exactly-once semantics, and the kafka CLI plus Java producer and consumer APIs. A developer reaches for it when building event-driven services, log aggregation, or microservices messaging on Kafka.
- Reference card teaching an agent to run Apache Kafka: topics, partitions, consumer groups
- Includes CLI (kafka-topics.sh), Java producer/consumer snippets, and SASL/SSL auth notes
- Covers exactly-once semantics, retention config, and error handling with backoff
Kafka by the numbers
- 53 all-time installs (skills.sh)
- Ranked #3,215 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
- Data as of Jul 28, 2026 (Skillselion catalog sync)
kafka capabilities & compatibility
Free skill; requires a running Kafka cluster and SASL/SSL credentials via env vars like KAFKA_CLIENT_API_KEY
- Capabilities
- event streaming · message production · message consumption · stream processing
- Works with
- kafka
- Use cases
- devops · data analysis
What kafka says it does
Apache Kafka is a distributed event streaming platform used for building real-time data pipelines and streaming apps, enabling high-throughput, fault-tolerant messaging.
Offers exactly-once semantics via transactional APIs to prevent data loss or duplication.
Handles high volumes with configurable retention policies, e.g., retaining messages for 7 days using `log.retention.hours=168` in broker config.
npx skills add https://github.com/alphaonedev/openclaw-graph --skill kafkaAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 53 |
|---|---|
| repo stars | ★ 6 |
| Last updated | March 13, 2026 |
| Repository | alphaonedev/openclaw-graph ↗ |
What it does
Reference for wiring an agent or backend service to produce and consume messages on an Apache Kafka event-streaming cluster.
Who is it for?
Real-time data ingestion, log aggregation, event-driven architectures, and microservices messaging
Skip if: Simple queueing needs where a lighter tool like RabbitMQ suffices
When should I use this skill?
You need an agent to create Kafka topics, produce/consume messages, or configure retention and consumer groups
By the numbers
- retention example retains messages 7 days via log.retention.hours=168
- topic create example uses 3 partitions and replication-factor 2
Files
kafka
Purpose
Apache Kafka is a distributed event streaming platform used for building real-time data pipelines and streaming apps, enabling high-throughput, fault-tolerant messaging.
When to Use
Use Kafka for scenarios requiring real-time data ingestion and processing, such as log aggregation, event-driven architectures, or microservices communication; avoid it for simple queueing needs where lighter tools like RabbitMQ suffice.
Key Capabilities
- Supports distributed streaming with topics, partitions, and replicas for scalability and durability.
- Offers exactly-once semantics via transactional APIs to prevent data loss or duplication.
- Handles high volumes with configurable retention policies, e.g., retaining messages for 7 days using
log.retention.hours=168in broker config. - Provides consumer groups for load balancing, where multiple consumers share a group ID to partition topic consumption.
- Integrates streaming processing via Kafka Streams API for stateful transformations, like aggregating events with
KTableobjects.
Usage Patterns
To produce messages, create a topic first, then use a producer client; for consumption, subscribe to a topic and process messages in a loop. Always handle offsets manually or via auto-commit to avoid reprocessing. For batch processing, use Kafka Connect to ingest data from sources like databases. Pattern: Use idempotent producers for at-least-once delivery by setting enable.idempotence=true in producer configs.
Common Commands/API
Use Kafka CLI for quick operations:
- Create a topic:
kafka-topics.sh --create --topic mytopic --bootstrap-server localhost:9092 --partitions 3 --replication-factor 2 - Produce messages:
kafka-console-producer.sh --topic mytopic --bootstrap-server localhost:9092(type messages and press Ctrl+D to send) - Consume messages:
kafka-console-consumer.sh --topic mytopic --from-beginning --bootstrap-server localhost:9092 --group mygroup
For API usage in Java:
- Producer example:
Properties props = new Properties(); props.put("bootstrap.servers", "localhost:9092");
props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
KafkaProducer<String, String> producer = new KafkaProducer<>(props);
producer.send(new ProducerRecord<>("mytopic", "key", "value"));- Consumer example:
Properties props = new Properties(); props.put("bootstrap.servers", "localhost:9092");
props.put("group.id", "mygroup"); props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
KafkaConsumer<String, String> consumer = new KafkaConsumer<>(props);
consumer.subscribe(Collections.singletonList("mytopic"));
ConsumerRecords<String, String> records = consumer.poll(Duration.ofMillis(100));Authenticate with SASL using env var: Set $KAFKA_SASL_JAAS_CONFIG to "org.apache.kafka.common.security.plain.PlainLoginModule required username='$SERVICE_API_KEY';".
Integration Notes
Integrate Kafka with other systems via Kafka Connect for sources/sinks, e.g., JDBC connector for databases. For authentication, use SSL or SASL with keys from env vars like $KAFKA_CLIENT_API_KEY. When linking to Spark, configure Spark Streaming with spark.kafka.bootstrap.servers and include dependencies like spark-sql-kafka-0-10_2.12. For microservices, use Kafka as a backbone with producers sending events to topics and consumers reacting via webhooks. Always specify exact versions, e.g., Kafka 3.4.0 with Confluent Schema Registry at endpoint http://localhost:8081/subjects.
Error Handling
Handle common errors like connection failures by checking broker availability and retrying with exponential backoff; for example, in code, wrap producer.send() in a try-catch and retry up to 3 times. If offsets are out of range, use auto.offset.reset=earliest in consumer configs to start from the beginning. For authentication errors (e.g., 401 Unauthorized), verify env vars like $SERVICE_API_KEY and ensure SASL mechanisms match. Log errors with details, e.g., in Java: catch (KafkaException e) { log.error("Kafka error: {}", e.getMessage()); }. Address broker crashes by monitoring replicas and using min.insync.replicas=2 to enforce acknowledgment.
Graph Relationships
- Belongs to cluster: data-engineering
- Related tags: event-streaming, data-pipelines, kafka
- Potential links: integrates with skills in data-engineering cluster, such as spark or hadoop for data processing pipelines.
Related skills
FAQ
When should I use Kafka instead of RabbitMQ?
Use Kafka for high-throughput real-time data pipelines, event-driven architectures, and log aggregation; use lighter tools like RabbitMQ for simple queueing needs.
How do you get exactly-once delivery in Kafka?
Use idempotent producers by setting enable.idempotence=true and Kafka's transactional APIs to prevent data loss or duplication.