Producers events को Kafka topics में publish (लिखते) करते हैं, और consumers उनसे events को subscribe (पढ़ते) करते हैं। वे कैसे काम करते हैं यह समझना — partitioning, offsets और consumer groups सहित — Kafka का उपयोग करने के लिए मूलभूत है।
Producers — events लिखना
PRODUCERS publish events to TOPICS:
→ send a record (key, value) to a topic
→ the key determines the PARTITION (same key → same partition → ordering for that key);
no key → distributed (round-robin)
→ can configure ACKNOWLEDGMENTS (acks) for durability (wait for replicas to confirm)
→ batching, compression for throughput
