Kafka Spout没有消耗某些分区的消息

时间:2017-01-22 05:50:07

标签: apache-kafka apache-storm

我是Storm新手, 这些是我的Storm配置

val builder = new TopologyBuilder()
  builder.setSpout("kafka-spout", new AlgoKafkaSpout().buildKafkaSpout(), 4)
  builder.setBolt("wlref-bolt", new WlrefBolt, 4).shuffleGrouping("kafka-spout")
  builder.setBolt("params-bolt", new ParamsBolt, 4).shuffleGrouping("wlref-bolt")
  builder.setBolt("gender-bolt", new GenderBolt, 4).shuffleGrouping("params-bolt")
  builder.setBolt("age-bolt", new AgeBolt, 4).shuffleGrouping("gender-bolt")
  builder.setBolt("preference-bolt", new PreferenceBolt, 4).shuffleGrouping("age-bolt")
  builder.setBolt("geo-bolt", new GeoBolt, 4).shuffleGrouping("preference-bolt")
  builder.setBolt("device-bolt", new DeviceBolt, 4).shuffleGrouping("geo-bolt")
  builder.setBolt("druid-bolt", new AlgoBeamBolt[java.util.Map[String, AnyRef]](new MyBeamFactory), 4)
   .shuffleGrouping("device-bolt")
  builder.setBolt("redis-bolt",new RedisBolt,4).shuffleGrouping("druid-bolt")

  val conf = new Config()
  conf.setDebug(false)
  conf.setMessageTimeoutSecs(120)
  conf.setNumWorkers(1)
  StormSubmitter.submitTopology(args(0), conf, builder.createTopology)

这就是我的KafkaSpout

val hosts = new ZkHosts(s"${Config.zkHost}:${Config.zkPort}") 
    val topic = Config.kafkaTopic 
    val zkRoot = s"/$topic"+"7" 
    val groupId = Config.kafkaGroup
    val kafkaConfig = new SpoutConfig(hosts, topic, zkRoot, UUID.randomUUID().toString())
    kafkaConfig.scheme = new SchemeAsMultiScheme(new StringScheme())
    kafkaConfig.startOffsetTime = kafka.api.OffsetRequest.LatestTime
    new KafkaSpout(kafkaConfig)

我们每秒生成大约400到1000条消息。我们在Kafka主题中制作了4个分区。 几个小时后我们正确地消费了消息但是有一段时间后kafkaSpout没有消耗来自某些分区的消息

这是消息消费报告

enter image description here

如果需要任何其他信息,请告知我们。

修改

卡夫卡版本:kafka_2.11-0.10.1.1

风暴版:apache-storm-0.10.2

Sbt Dependencies

"org.apache.storm" % "storm-core" % "0.10.2" % "provided",
"org.apache.storm" % "storm-kafka" % "0.10.2" /*% "provided"*/,
"org.apache.kafka" %% "kafka" % "0.10.0.1" 

0 个答案:

没有答案