Producer publish (เขียน) event ไปยัง topic ของ Kafka และ consumer subscribe (อ่าน) event จากมัน การเข้าใจว่ามันทำงานอย่างไร — รวมถึง partitioning, offset และ consumer group — เป็นพื้นฐานในการใช้ Kafka
Producer — การเขียน event
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
