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权威指南
72
4
包的一部分,属于
Kafka
核心模块。它们分别被叫作
SimpleConsumer(简单消费者,实际
上也不是那么简单,它们是对
Kafka API
的轻度包装,可以用于从特定的分区和偏移量开
始读取消息)和高级消费者。高级消费者指的就是 ZookeeperConsumerConnector,它有点
像现在的消费者,有消费者群组,有分区再均衡,不过它使用
Zookeeper
来管理消费者群
组,并不具备提交偏移量和再均衡的可操控性。
因为现在的消费者同时支持以上两种行为,并且为开发人员提供了更高的可靠性和可操控
性,所以我们不打算讨论旧版
API
。如果你想使用它们,那么请三思,如果确定要使用,
可以从
Kafka
文档中了解更多的信息。
4.13
 总结
我们在本章开头解释了
Kafka
消费者群组概念,消费者群组支持多个消费者从主题上读取
消息。在介绍完概念之后,我们又给出了一个消费订阅主题并持续读取消息的例子。然后
介绍了一些重要的消费者配置参数以及它们对消费者行为的影响。我们用一大部分内容解
释偏移量以及消费者是如何管理偏移量的。了解消费者提交偏移量的方式有助更好地使用
消费者客户端,所以我们介绍了几种不同的偏移量提交方式。然后又探讨了消费者
API
其他话题,比如如何处理再均衡以及如何关闭消费者。
最后,我们介绍了反序列化器,消费者客户端使用反序列化器将保存在
Kafka
里的字节转
换成应用程序可以处理的
Java
对象。我们主要介绍了
Avro
反序列化器,虽然有很多可用
的反序列化器,但在
Kafka
里,
Avro
是最为常用的一个。 ...
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