Producer menerbitkan (menulis) event ke topic Kafka, dan consumer melanggan (membaca) event daripadanya. Memahami cara ia berfungsi — termasuk partitioning, offset, dan consumer group — adalah asas untuk menggunakan Kafka.
Producer — menulis 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
