根据 AWS docs :
The worker invokes record processor methods using Java ExecutorService tasks. If a task fails, the worker retains control of the shard that the record processor was processing. The worker starts a new record processor task to process that shard. For more information, see Read Throttling.
根据 another page在 AWS 文档上:
The Kinesis Client Library (KCL) relies on your processRecords code to handle any exceptions that arise from processing the data records. Any exception thrown from processRecords is absorbed by the KCL. To avoid infinite retries on a recurring failure, the KCL does not resend the batch of records processed at the time of the exception. The KCL then calls processRecords for the next batch of data records without restarting the record processor. This effectively results in consumer applications observing skipped records. To prevent skipped records, handle all exceptions within processRecords appropriately.
这两个不是自相矛盾的说法吗?一个说记录处理器重新启动,另一个说跳过了分片。
当记录处理器出现故障时,KCL 究竟会做什么? KCL 工作人员如何知道记录处理器是否发生故障?
最佳答案
根据我编写、调试和支持基于 KCL 的应用程序的经验,第二个语句更清晰/准确/有用,用于描述您应该如何考虑错误处理。
首先介绍一下背景:
第一条语句试图(不是很清楚地)说明当 KCL 任务失败时,该工作程序实例将保持对其正在处理的分片的控制(而不是将它们转移给另一个工作程序)。
关于amazon-web-services - Kinesis 客户端库记录处理器故障,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47056385/