FYI, I have already created the following issue:

- https://issues.apache.org/jira/browse/FLINK-27872


>From the issue description directly:


Currently, KafkaBuilder
<https://github.com/apache/flink/blob/master/flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/source/KafkaSourceBuilder.java>
has
two setters:

   - setTopics
   
<https://github.com/apache/flink/blob/586715f23ef49939ab74e4736c58d71c643a64ba/flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/source/KafkaSourceBuilder.java#L157>
   - setTopicPattern
   
<https://github.com/apache/flink/blob/586715f23ef49939ab74e4736c58d71c643a64ba/flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/source/KafkaSourceBuilder.java#L168>

which under the hood instantiate the corresponding (concrete) subscribers.
This covers the most common needs, I agree, but it might fall short in some
cases. Why not add a more generic setter:

   - setKafkaSubscriber (???)

*Otherwise, how can users read from kafka in combination with custom
subscribing logic? Without looking much into it, it seems that they
basically cannot, at least without having to replicate some parts of the
connector, which seems rather inconvenient.*

Reply via email to