Windows环境consumer.poll(100)没反应

Gasaraki 发表于: 2020-05-06   最后更新时间: 2020-05-07 13:43:21   1,837 游览

初学,Windows环境用的kafka_2.12-1.0.1,命令行客户端可以发送接收,本机互调,java程序在consumer.poll(100)时卡住不动了,参照其他解答在config/server.properties中添加了listeners=PLAINTEXT://127.0.0.1:9092后还是不行,卡住之前控制台打印如下:

2020-05-06 20:55:45.925 [scheduler_Worker-1]  INFO  org.apache.kafka.clients.consumer.ConsumerConfig[238] - ConsumerConfig values: 
    auto.commit.interval.ms = 1000
    auto.offset.reset = earliest
    bootstrap.servers = [127.0.0.1:2181]
    check.crcs = true
    client.id = 
    connections.max.idle.ms = 540000
    enable.auto.commit = true
    exclude.internal.topics = true
    fetch.max.bytes = 52428800
    fetch.max.wait.ms = 500
    fetch.min.bytes = 1
    group.id = alarm-ivr-group
    heartbeat.interval.ms = 3000
    interceptor.classes = null
    internal.leave.group.on.close = true
    isolation.level = read_uncommitted
    key.deserializer = class org.apache.kafka.common.serialization.StringDeserializer
    max.partition.fetch.bytes = 1048576
    max.poll.interval.ms = 300000
    max.poll.records = 500
    metadata.max.age.ms = 300000
    metric.reporters = []
    metrics.num.samples = 2
    metrics.recording.level = INFO
    metrics.sample.window.ms = 30000
    partition.assignment.strategy = [class org.apache.kafka.clients.consumer.RangeAssignor]
    receive.buffer.bytes = 65536
    reconnect.backoff.max.ms = 1000
    reconnect.backoff.ms = 50
    request.timeout.ms = 305000
    retry.backoff.ms = 100
    sasl.jaas.config = null
    sasl.kerberos.kinit.cmd = /usr/bin/kinit
    sasl.kerberos.min.time.before.relogin = 60000
    sasl.kerberos.service.name = null
    sasl.kerberos.ticket.renew.jitter = 0.05
    sasl.kerberos.ticket.renew.window.factor = 0.8
    sasl.mechanism = GSSAPI
    security.protocol = PLAINTEXT
    send.buffer.bytes = 131072
    session.timeout.ms = 30000
    ssl.cipher.suites = null
    ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
    ssl.endpoint.identification.algorithm = null
    ssl.key.password = null
    ssl.keymanager.algorithm = SunX509
    ssl.keystore.location = null
    ssl.keystore.password = null
    ssl.keystore.type = JKS
    ssl.protocol = TLS
    ssl.provider = null
    ssl.secure.random.implementation = null
    ssl.trustmanager.algorithm = PKIX
    ssl.truststore.location = null
    ssl.truststore.password = null
    ssl.truststore.type = JKS
    value.deserializer = class org.apache.kafka.common.serialization.StringDeserializer

2020-05-06 20:55:46.102 [scheduler_Worker-1]  INFO  org.apache.kafka.common.utils.AppInfoParser[109] - Kafka version : 1.0.1
2020-05-06 20:55:46.103 [scheduler_Worker-1]  INFO  org.apache.kafka.common.utils.AppInfoParser[110] - Kafka commitId : c0518aa65f25317e

刚学着搭建,各方面不太熟,搜了半天不知道如何下手,希望有大佬可以解答下

发表于 2020-05-06

哎,低级了,昨天自己从头核对参数,发现bootstrap.servers配错了,默认是9092....一直没往这个方向想....

沃德 -> Gasaraki 4年前

我的端口是正确的,但是也遇到这个问题了。控制台一直输出,无法消费数据

你的答案

查看kafka相关的其他问题或提一个您自己的问题