Apache Producers Consumers

Posted on Aug 13, 2024
  • Producers are clients usually applications which produces messages of several formats like activity tracking, events, log messages, transactions etc.
  • Consumers are Applications read messages from topics.
  • consumers track offset to know how many messages they read.
  • data written to kafka is replicated in the disk for fault tolerance
  • Acks: property for number of acknowledgement for producer to make sure message sent to cluster
  • Key: producers specify a key, indicating that a message will go to the same partition every time

Consumer Group

​ To ensure multiple consumers aren’t reading the same message, consumer groups map reads to consumers. Same message wont read by multiple consumers. Consumer group contains, multiple consumers of same topic, so if throughput is more, then to match the load we add multiple consumers to that topic and create a consumer group.