我有一个 .war,其中我们有一个 Kinesis 应用程序,它处理一个包含单个分片的流。我们在生产中部署了两个战争实例。结果,我最终会得到两个工人在一个带有单个分片的流上工作。处理此问题的推荐方法是什么?我尝试在本地开发机器上部署两次战争,从某种意义上说,每条记录只处理一次似乎很好。我知道 AWS 建议每个分片一个实例。从他们的文档中:
Typically, when you use the KCL, you should ensure that the number of instances does not exceed the number of shards (except for failure standby purposes). Each shard is processed by exactly one KCL worker and has exactly one corresponding record processor, so you never need multiple instances to process one shard.