如果javaapi长时间消费不到数据

本文介绍了解决Java API长时间无法从Kafka集群中消费数据的问题,通过在server.properties中配置advertised.host.name和advertised.port参数,确保生产者和消费者能够正确地连接到Kafka集群。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

如果javaapi长时间消费不到数据,需要在kafka集群中的server.properties配置如下代码:

# Hostname the broker will advertise to producers and consumers. If not set, i$ # value for "host.name" if configured. Otherwise, it will use the value retur$

# java.net.InetAddress.getCanonicalHostName().

advertised.host.name=192.168.146.104

# The port to publish to ZooKeeper for clients to use. If this is not set, # it will publish the same port that the broker binds to.

advertised.port=9092

转载于:https://www.cnblogs.com/hdfs/p/9972188.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值