</dependency>
2.kafka实践demo的producer已经能够往kafka里发布消息。
3.consumer却一直配置出错,在apache的官网上找不到这版本kafka-clients的示例,配置如下:
props.put("group.id", "test");
props.put("partition.assignment.strategy", "range");
报错如下:
2015-07-27 15:43:48,616 [main] WARN [org.apache.kafka.clients.consumer.ConsumerConfig] - The configuration group.id = test was supplied but isn't a known config.
2015-07-27 15:43:48,616 [main] WARN [org.apache.kafka.clients.consumer.ConsumerConfig] - The configuration partition.assignment.strategy = range was supplied but isn't a known config.
各路大神,麻烦帮我看看。
WeareintheprocessofrewrittingtheJVMclientsforKafka.Asof0.8.2KafkaincludesanewlyrewrittenJavaproducer.ThenextreleasewillincludeanequivalentJavaconsumer
貌似官方说Consumer还未实现
嗯,貌似是这样。https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Example
https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Example
consumer示例。
maven依赖:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>0.8.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.10</artifactId>
<version>0.8.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-examples</artifactId>
<version>0.8.2.1</version>
</dependency>
</dependencies>
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。