Producers Kafka topics میں events شائع کرتے ہیں (لکھتے ہیں)، اور 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
