We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
没有办法配置key,所以分区规则就只能组默认的规则,粘性分区。无法指定分区,让数据均匀到各个分区。不知道我说的作者明白了么。。。希望共同探讨解决方案。
4.1.3 (Default)
No response
Oracle JDK 1.8.0
The text was updated successfully, but these errors were encountered:
很抱歉 你说的我的确没明白
Sorry, something went wrong.
kafka生产者有分区策略,随机分区,roundrobin分区,粘性分区,按key分区。有一个按key分区策略,它能按照指定key的hash值去分配不同的数据到不同的分区,我想设置分区key,然后实现以上功能,能指定怎么配置吗?或者说目前无法配置?
目前可以通过设置 properties 来制定额外的属性,如果要设置分区策略,你可以这样配置你的 json 文件
properties
{ "writer": { "name": "kafkawriter", "parameter": { "brokerList": "localhost:9092", "topic": "test-1", "partitions": 0, "batchSize": 1000, "column": ["col1", "col2","col3","col4","col5", "col6", "col7", "col8", "col9"], "properties": { "partitioner.class": "org.apache.kafka.clients.producer.internals.DefaultPartitioner", } } } }
其中分区策略对应的值分别为:
org.apache.kafka.clients.producer.internals.DefaultPartitioner"
org.apache.kafka.clients.producer.internals.UniformStickyPartitioner
org.apache.kafka.clients.producer.internals.RoundRobinPartitioner
wgzhao
No branches or pull requests
What happened?
没有办法配置key,所以分区规则就只能组默认的规则,粘性分区。无法指定分区,让数据均匀到各个分区。不知道我说的作者明白了么。。。希望共同探讨解决方案。
Version
4.1.3 (Default)
OS Type
No response
Java JDK Version
Oracle JDK 1.8.0
Relevant log output
No response
The text was updated successfully, but these errors were encountered: