Skip to Content
Kafka权威指南(第2版)
book

Kafka权威指南(第2版)

by Gwen Shapira, Todd Palino, Rajini Sivaram, Krit Petty
November 2022
Beginner to intermediate
346 pages
11h
Chinese
Posts & Telecom Press
Content preview from Kafka权威指南(第2版)
132
7
结果写入主题并提交偏移量。一般来说,这是一个比较复杂的问题,建议尝试使用其他框
架,比如
Kafka Streams
Flink
,它们为聚合
、连接、时间窗和其他复杂的分析操作提供
了高级的
DSL
API
7.6
 验证系统可靠性
经过了所有这些流程(确认可靠性需求、配置
broker
、配置客户端和正确使用
API
),现在
可以把所有东西都部署到生产环境中,然后高枕无忧,自信不会丢失任何消息了,对吗?
建议还是先对系统可靠性做
3
个层面的验证
:验证配置、验证应用程序以及在生产环境中
监控可靠性。下面来看看每一步都需要验证什么以及如何验证。
7.6.1
 验证配置
可以抛开应用程序逻辑,单独验证
broker
和客户端的配置。之所以建议这么做,主要是因
为以下两个原因。
有助于验证配置是否能够满足需求。
有助于了解系统的预期行为。
Kafka
提供了两个重要的配置验证工具
org.apache.kafka.tools
包下面的
VerifiableProducer
类和
VerifiableConsumer
类。可以在命令行中运行这两个工具,或把它们嵌入自动化测试框
架中。
VerifiableProducer
会生成一系列消息,消息里包含了一个从
1
到指定数字的数字。可以
使用与真实的生产者相同的配置参数来配置
VerifiableProducer
,比如配置相同的
acks
retries
delivery.timeout.ms
和消息生成速率。在运行过程中,
VerifiableProducer
会根据收到的确认响应将每条消息发送成功或失败的结果打印出来 ...
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

时间序列分析实战:基于机器学习和统计学

时间序列分析实战:基于机器学习和统计学

Aileen Nielsen
Spark机器学习实战

Spark机器学习实战

Posts & Telecom Press, Siamak Amirghodsi, Meenakshi Rajendran, Broderick Hall, Shuen Mei
写给系统管理员的Python脚本编程指南

写给系统管理员的Python脚本编程指南

Posts & Telecom Press, Ganesh Sanjiv Naik
Kubernetes编程

Kubernetes编程

Michael Hausenblas, Stefan Schimanski

Publisher Resources

ISBN: 9787115601421