以下在kafka中启用压缩的方法之间有什么区别:
方法1:使用命令创建主题:
bin/kafka-topics.sh --create --zookeeper localhost:2181 --config compression.type=gzip --topic test
Run Code Online (Sandbox Code Playgroud)
方法2:在Kafka Producer Client API中设置属性compression.type = gzip.
使用方法1时,我获得了更好的压缩和更高的吞吐量.
如果我使用方法1,是否意味着压缩发生在代理端,而在方法2中,消息在生产者端压缩然后发送到代理?