Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-3061

Kafka Consumer is not failing if broker is not available

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.0.0
    • Connectors / Kafka
    • None

    Description

      It seems that the FlinkKafkaConsumer is just logging the errors when trying to get the initial list of partitions for the topic, but its not failing.

      The following code ALWAYS runs, even if there is no broker or zookeeper running.

       def main(args: Array[String]) {
          val env = StreamExecutionEnvironment.getExecutionEnvironment
          val properties = new Properties()
          properties.setProperty("bootstrap.servers", "localhost:9092")
          properties.setProperty("zookeeper.connect", "localhost:2181")
          properties.setProperty("group.id", "test")
          val stream = env
            .addSource(new FlinkKafkaConsumer082[String]("topic", new SimpleStringSchema(), properties))
            .print
      
          env.execute("Flink Kafka Example")
        }
      

      The runtime consumers are designed to idle when they have no partitions assigned, but there is no check that there are no partitions at all.

      Attachments

        Activity

          People

            rmetzger Robert Metzger
            rmetzger Robert Metzger
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: