Apache Storm 没有收到来自 kafka 的消息

Apache Storm not receiving messages from kafka

我正在尝试将 Apache Storm 与 Kafka 集成。连接似乎建立良好但没有收到任何消息。但是消息似乎也已发送到 Kafka 服务器,而 Kafka 服务器中相应主题的索引文件显示存在一些数据。有没有办法在 Storm end 上对此进行更多调试..?我在 Storm 中使用客户解码器来处理消息。 Storm 的实现是:

TopologyBuilder builder = new TopologyBuilder();
Broker brokerForPartition0 = new Broker("xxxxx");
GlobalPartitionInformation partitionInfo = new GlobalPartitionInformation();
partitionInfo.addPartition(0, brokerForPartition0);
StaticHosts hosts = new StaticHosts(partitionInfo);
SpoutConfig spoutConfig = new SpoutConfig(hosts, TOPIC, "/"+TOPIC, clientId);
spoutConfig.scheme = new MyLogScheme();
builder.setSpout("spout", new KafkaSpout(spoutConfig));
builder.setBolt("printer", new PrinterBolt());
Config conf = new Config();
conf.setDebug(true);
LocalCluster cluster = new LocalCluster();
cluster.submitTopology("test", conf, builder.createTopology());

您正在使用自己的方案"MyLogScheme"。问题可能出在 myLogScheme 中。尝试使用默认方案,即 StringScheme。希望这会让您看到一些消息。

检查主 Storm 拓扑中的主题名称。 kafka 和 storm 主题都是一样的。检查kafka主题中的经纪人