KafkaConsumer partition-assignment example

KafkaConsumer partition-assignment example An architecture diagram generated by Archify. Producer · topic: orders · Architecture component Producer topic: orders orders · Partition 0 · Leader replica · Broker 1 orders · Partition 0 Leader replica orders · Partition 1 · Leader replica · Broker 2 orders · Partition 1 Leader replica orders · Partition 2 · Leader replica · Broker 3 orders · Partition 2 Leader replica Consumer 1 · assigned Partition 0 · Logical consumer group: order-processor Consumer 1 assigned Partition 0 Consumer 2 · assigned Partition 1 · Logical consumer group: order-processor Consumer 2 assigned Partition 1 Consumer 3 · assigned Partition 2 · Logical consumer group: order-processor Consumer 3 assigned Partition 2 write messages example 3:3 assignment Broker 1 Broker 2 Broker 3 Logical consumer group: order-processor Legend Backend Message bus External

Partitions

  • • Writes go to partition leaders
  • • Configured follower fetching is also possible

KafkaConsumer

  • • Three partitions and three consumers are one example
  • • One consumer can own multiple partitions