开发者社区> 问答> 正文

kafka java客户端kafka-clients 0.8.2.1?报错

  1. 首先maven依赖如下:
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>0.8.2.1</version>

</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.

    各路大神,麻烦帮我看看。

展开
收起
爱吃鱼的程序员 2020-06-12 15:36:30 790 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    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>

    2020-06-12 15:36:47
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载