1. 程式人生 > >如果javaapi長時間消費不到資料

如果javaapi長時間消費不到資料

如果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