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

Make "schema-registry.subject" optional for Kafka sink with avro-confluent format

    XMLWordPrintableJSON

Details

    Description

      Currently, configuration "schema-registry.subject" in avro-confluent format is required by sink. However, this is quite verbose set it manually. By default, it can be to set to <topic_name>-key and <topic_name>-value if it works with kafka or upsert-kafka connector. This can also makes 'avro-confluent' format to be more handy and works better with Kafka/Confluent ecosystem.

      CREATE TABLE kafka_gmv (
        day_str STRING,
        gmv BIGINT,
        PRIMARY KEY (day_str) NOT ENFORCED
      ) WITH (
          'connector' = 'upsert-kafka',
          'topic' = 'kafka_gmv',
          'properties.bootstrap.servers' = 'localhost:9092',
          -- 'key.format' = 'raw',
          'key.format' = 'avro-confluent',
          'key.avro-confluent.schema-registry.url' = 'http://localhost:8181',
          'key.avro-confluent.schema-registry.subject' = 'kafka_gmv-key',
          'value.format' = 'avro-confluent',
          'value.avro-confluent.schema-registry.url' = 'http://localhost:8181',
          'value.avro-confluent.schema-registry.subject' = 'kafka_gmv-value'
      );
      

      Attachments

        Issue Links

          Activity

            People

              ZhuShang zhuxiaoshang
              jark Jark Wu
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: