Skip to Content
Kafka权威指南
book

Kafka权威指南

by Neha Narkhede, Gwen Shapira, Todd Palino
January 2018
Beginner to intermediate
234 pages
7h 8m
Chinese
Posts & Telecom Press
Content preview from Kafka权威指南
80
5
消费者只能看
到这些消息
副本0
消息0
副本1 副本2
消息1
消息2
消息3
消息0
消息1
消息2
消息0
消息1
消息2
消息3
消息4
高水位
5-4:消费者只能看到已经复制到 ISR 的消息
5.4.3
 其他请求
到此为止,我们讨论了
Kafka
最为常见的几种请求类型:元数据请求、生产请求和获取
请求。重要的是,我们讨论的是客户端在网络上使用的通用二进制协议。
Kafka
内置了由
开源社区贡献者实现和维护的
Java
客户端,同时也有用其他语言实现的客户端,如
C
Python
Go
语言等。
Kafka
网站上有它们的完整清单,这些客户端就是使用这个二进制协
议与
broker
通信的。
另外,
broker
之间也使用同样的通信协议。它们之间的请求发生在
Kafka
内部,客户端不
应该使用这些请求。例如,当一个新首领被选举出来,控制器会发送 LeaderAndIsr 请求给
新首领(这样它就可以开始接收来自客户端的请求)和跟随者(这样它们就知道要开始跟
随新首领)。
在我们写这本书的时候,
Kafka
协议可以处理
20
种不同类型的请求,而且会有更多的类
型加入进来。协议在持续演化——随着客户端功能的不断增加,我们需要改进协议来满足
需求。例如,之前的
Kafka
消费者使用
Zookeeper
来跟踪偏移量,在消费者启动的时候,
它通过检查保存在
Zookeeper
上的偏移量就可以知道从哪里开始处理消息。因为各种原
因,我们决定不再使用
Zookeeper
来保存偏移量,而是把偏移量保存在特定的
Kafka
主题
上。为了达到这个目的,我们不得不往协议里增加 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

精通機器學習

精通機器學習

Aurélien Géron
精通特征工程

精通特征工程

Alice Zheng, Amanda Casari
高效能PYTHON程式設計

高效能PYTHON程式設計

Micha Gorelick, Ian Ozsvald

Publisher Resources

ISBN: 9787115473271