Hi Richard,

Producing to multiple topics is treated a bit differently in the Flink Kafka 
producer.
You need to set a single default target topic, and in 
`KeyedSerializationSchema#getTargetTopic()` you can override the default topic 
with whatever is returned. The `getTargetTopic` method is invoked for each 
record.

Cheers,
Gordon


On 6 July 2017 at 9:09:29 AM, Richard Xin (richardxin...@yahoo.com) wrote:

when using FlinkKafkaConsumer010 to subscribing multiple topics as 
List<String> topics = Arrays.asList("test1","test2");

DataStream<String> stream = env.addSource(new FlinkKafkaConsumer010<>(topics, 
new SimpleStringSchema(), properties));

How do I get topic names in my SinkFunction? i.e. stream.addSink()

Thanks,
Richard

Reply via email to