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

Add more Kafka topic option of flink-connector-kafka

    XMLWordPrintableJSON

Details

    Description

      Currently, only 'topic' option implemented in the Kafka Connector Descriptor, we can only use it like :

          val env = StreamExecutionEnvironment.getExecutionEnvironment
          val tableEnv = StreamTableEnvironment.create(env)
      
          tableEnv
            .connect(
              new Kafka()
                .version("0.11")
                .topic("test-flink-1")
                .startFromEarliest()
                .property("zookeeper.connect", "localhost:2181")
                .property("bootstrap.servers", "localhost:9092"))
            .withFormat(
              new Json()
                .deriveSchema()
            )
            .withSchema(
              new Schema()
                .field("name", Types.STRING)
                .field("age", Types.STRING)
            )

      but we cannot consume multiple topics or a topic regex pattern. 

      Here is my thoughts:

                .topic("test-flink-1") 
                //.topics("test-flink-1,test-flink-2") or topics(List<String> topics)
                //.subscriptionPattern("test-flink-.*") or subscriptionPattern(Pattern pattern)
      

      I already implement the code on my local env with help of the FlinkKafkaConsumer, and it works.

      Attachments

        Issue Links

          Activity

            People

              dubin555 DuBin
              dubin555 DuBin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 48h
                  48h
                  Remaining:
                  Remaining Estimate - 47h 50m
                  47h 50m
                  Logged:
                  Remaining Estimate - 47h 50m
                  10m