Kafka utilizes Zoookeeper for storing Metadata information about the brokers, topics, and partititions.
Producer
Sending a Message to Kafka
Sending a Message Asynchronously
Configuring Producers
acks =1, all
Chapter 4
Kafka Consumers: Reading Data from Kafka
Kafka consumers are typically part of a consumer group.
Rebalance
Creating a Kafka Consumer
The Poll Loop
Thread Safety
One consumer per thread is the rule.
It is useful to wrap the consumer logic in its own object and then use Java’s ExecutorService to start multiple threads each with its own consumer.
Configuring Consumers
Commits and Offsets
Consumer: How Do We Exit
Chapter 5:Kafka Internals
Cluster Membership
Every broker has a unique identifier that is either set in the broker configuration file or automatically generated. Every time a broker process starts, it registers itself with its ID in Zookeeper by creating an ephemeral node.
To summarize, Kafka uses Zookeeper’s ephemeral node feature to elect a controller and to notify the controller when nodes join and leave the cluster. The controller is responsible for electing leaders among the partitions and replicas whenever it notices nodes join and leave the cluster. The controller uses the epoch number to prevent a “split brain” scenario where two nodes believe each is the current controller.
Replication
Request Processing
Fetch Requests
Physical Storage
The partitions will be stored in the log.dirs.
Partition Allocation
File Management
Indexes
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。