public-kafka-expert-base
Skill25 starsChanged 4 months agoApache-2.0View on GitHub
Kafka 知识基座。覆盖 Topics/Partitions、Consumer Groups、Producer/Consumer Config、Serialization、Exactly-Once、Rebalancing。供 devlab-middleware-expert 通过 extends 继承。
In this repository57 other files it gives its agents.
- base-cn-registry-mirror-strategySkill
- base-manual-captureSkill
- devlab-ai-agent-engineeringSkill
- devlab-ai-kit-minerSkill
- devlab-cicd-onboardSkill
- devlab-contract-web-serverSkill
- devlab-dao-sql-compatSkill
- devlab-db-data-migrationSkill
- devlab-eval-driven-agentSkill
- devlab-integration-fullstackSkill
- devlab-srv-test-apiSkill
- devlab-tech-debt-opsSkill
- devlab-test-expertSkill
- devlab-test-onboardSkill
- devlab-web-contextSkill
- devlab-web-deep-acceptanceSkill
- devlab-web-echarts-usageSkill
- devlab-web-engineeringSkill
- devlab-web-extension-bootstrapSkill
- devlab-web-skywalking-rum-usageSkill
- devlab-web-test-e2eSkill
- devlab-web-visual-opsSkill
- devlab-web-xyflow-usageSkill
- diag-container-oomSkill
- diag-k8s-node-pressureSkill
- diag-k8s-pod-crashloopSkill
- diag-mysql-deadlockSkill
- diag-mysql-replicationSkill
- diag-mysql-slow-querySkill
- diag-network-port-unreachSkill
- infra-dify-opsSkill
- infra-harbor-opsSkill
- infra-jenkins-pipeline-opsSkill
- infra-nexus-opsSkill
- infra-ragflow-opsSkill
- infra-sonarqube-opsSkill
- infra-system-env-opsSkill
- infra-woodpecker-pipeline-opsSkill
- markitdownSkill
- patent-disclosure-workflowSkill
- patent-reviewSkill
- patent-specification-writerSkill
- public-git-workflow-expert-baseSkill
- public-mongodb-expert-baseSkill
- public-mysql-expert-baseSkill
- public-nl2sql-expert-baseSkill
- public-oracle-expert-baseSkill
- public-postgres-expert-baseSkill
- public-rabbitmq-expert-baseSkill
- public-redis-expert-baseSkill
- work-convertSkill
- work-exportSkill
- work-markitdownSkill
- work-sc-document-sop-builderSkill
- work-sc-docx-comment-replySkill
- work-sc-patent-specification-writerSkill
- work-sc-software-copyright-writerSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Use partition keys for related messages that must be ordered (e.g., user_id for user events).
- Distinctive: line 19
All consumers in a group share the workload (each partition → one consumer).
- Very specific: line 22
Use auto.offset.reset=earliest for new groups that need to process all history.
- Very specific: line 44
Use Avro/Protobuf/JSON Schema with Schema Registry for type safety.
- Distinctive: line 45
Never use Java serialization (not cross-language, not forward-compatible).
- Very specific: line 50
Use isolation.level=read_committed on consumer (read only committed transactions).
- Very specific: line 55
Use cooperative rebalancing (partition.assignment.strategy=CooperativeStickyAssignor).
- Very specific: line 57
Use ConsumerRebalanceListener for cleanup on partition revocation.
- Very specific: line 60
Always set acks=all and enable.idempotence=true for producers.
- Very specific: line 61
Always use manual offset commits (enable.auto.commit=false).
- Distinctive: line 62
Never use Java serialization for Kafka messages.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Kafka Knowledge Base
Foundational guidance for building event streaming applications with Apache Kafka.
Source: Adapted from confluentinc/agent-skills and Apache Kafka best practices.
Topics & Partitions
- Design topics around domain events (
order.created,payment.completed), not database tables. - Partition count determines max consumer parallelism — start with 3-6, scale up as needed.
- Partitions are ordered; messages within a partition have guaranteed order.
- Use partition keys for related messages that must be ordered (e.g.,
user_idfor user events).
Consumer Groups
- All consumers in a group share the workload (each partition → one consumer).
- Multiple groups can independently consume the same topic (fan-out).
- Consumer offset tracking: committed offsets vs. current position.
- Use
auto.offset.reset=earliestfor new groups that need to process all history.
Producer Configuration
| Setting | Default | Recommended |
acks | 1 | all (durability) |
retries | 0 | 3+ (transient failures) |
linger.ms | 0 | 5-100 (batching) |
batch.size | 16KB | 32-64KB (throughput) |
compression.type | none | lz4 or zstd |
enable.idempotence | true | always true |
Consumer Configuration
| Setting | Default | Recommended |
auto.offset.reset | latest | earliest (first run) |
enable.auto.commit | true | false (manual commit) |
max.poll.records | 500 | Tune to processing capacity |
session.timeout.ms | 45s | 10-30s (failure detection) |
heartbeat.interval.ms | 3s | session.timeout / 3 |
Serialization
- Use Avro/Protobuf/JSON Schema with Schema Registry for type safety.
- Never use Java serialization (not cross-language, not forward-compatible).
- StringSerializer/StringDeserializer only for simple text messages.
Exactly-Once Semantics
- Enable
enable.idempotence=trueon producer (prevents duplicates from retries). - Use
isolation.level=read_committedon consumer (read only committed transactions). - For transactional processing:
beginTransaction()→ process →commitTransaction().
Rebalancing
- Triggered when consumers join/leave a group or partitions are reassigned.
- Use cooperative rebalancing (
partition.assignment.strategy=CooperativeStickyAssignor). - Handle
CommitFailedExceptionduring rebalance — retry after rebalance completes. - Use
ConsumerRebalanceListenerfor cleanup on partition revocation.
Guardrails
- Always set
acks=allandenable.idempotence=truefor producers. - Always use manual offset commits (
enable.auto.commit=false). - Never use Java serialization for Kafka messages.
- Monitor consumer lag (
kafka-consumer-groups --describe).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

