Kafka Streams:topic.compression.type不是已知的配置

时间:2018-11-20 21:27:56

标签: java apache-kafka apache-kafka-streams

在Kafka Streams中添加压缩配置,类似于此link

properties.put(StreamsConfig.topicPrefix(TopicConfig.COMPRESSION_TYPE_CONFIG), "snappy");

但是我在日志中看到以下警告消息:

[2018-11-19 23:52:10,158] WARN The configuration 'topic.compression.type' was supplied but isn't a known config. (org.apache.kafka.clients.admin.AdminClientConfig)
[2018-11-19 23:52:10,158] WARN The configuration 'topic.compression.type' was supplied but isn't a known config. (org.apache.kafka.clients.admin.AdminClientConfig)
[2018-11-19 23:52:10,194] WARN The configuration 'topic.compression.type' was supplied but isn't a known config. (org.apache.kafka.clients.consumer.ConsumerConfig)
[2018-11-19 23:52:10,194] WARN The configuration 'topic.compression.type' was supplied but isn't a known config. (org.apache.kafka.clients.consumer.ConsumerConfig)
[2018-11-19 23:52:10,209] WARN The configuration 'topic.compression.type' was supplied but isn't a known config. (org.apache.kafka.clients.producer.ProducerConfig)
[2018-11-19 23:52:10,209] WARN The configuration 'topic.compression.type' was supplied but isn't a known config. (org.apache.kafka.clients.producer.ProducerConfig)
[2018-11-19 23:52:10,221] WARN The configuration 'topic.compression.type' was supplied but isn't a known config. (org.apache.kafka.clients.consumer.ConsumerConfig)
[2018-11-19 23:52:10,221] WARN The configuration 'topic.compression.type' was supplied but isn't a known config. (org.apache.kafka.clients.consumer.ConsumerConfig)

不接受此设置吗?表达不好吗?

1 个答案:

答案 0 :(得分:2)

您可以忽略这些警告。 “问题”是,将主题config参数复制到内部使用的客户端的配置中,他们不知道参数名称,因此对它进行警告。但是,必须在客户端上设置这些配置,因为客户端会将这些配置“转发”到代码库中知道如何使用它们的其他部分。

这是一个不幸的问题,也是一个已知问题(但不易解决)。此问题有JIRA:https://issues.apache.org/jira/browse/KAFKA-6793