具有大型配置的 Kafka Connect 任务为空

Kafka Connect tasks empty with large config

如果我使用大型任务配置我的 Kafka 源连接器 epics2kafka starts, but no tasks are created. Using a smaller configuration appears to correct the problem. If I move my configuration into a file and pass just the file path along for the task to use, that also works (though no longer scales to distributed nodes as now relying on a local file!). It seems I'm running into a memory limit or internal REST service Post size constraint, or connect topic constraint of some kind. The weird thing is there doesn't appear to be any errors logged. The connector status is "RUNNING", but the task status is an empty array. Using print debug statements I can see the taskConfigs() method always completes, but if using a large config the start() method of the Connect task never is called. The large taskConfigs is 25,500 lines of JSON (about 2.5MB), which is added into the taskConfigs Map

相似(但不同):Kafka Connector's task list is empty

我使用的是 Kafka 的 3.1.0 版,所以我假设上述问题是不同的(看起来那个问题是由于 URL 内部 REST Post 请求的编码)。

必须增加生产者请求大小限制(对于 Kafka Connect 在内部用于编写任务配置的生产者)和主题消息大小限制(对于用于存储连接配置的主题)。我通过将 max.request.size=5242880 添加到 connect-distributed.properties 并将 max.message.bytes=5242880 添加到主题 connect-configs.

的主题配置,将它们增加到 5MB

参见:Kafka Users Discussion