I have a list of topics and I need to send messages to one of those topics, but based on some condition.
Assume that, producer is configured with a set of topics(lets say around 10 topics), Can we do something like below in Apache-flink ?
if(condition1){
send message to topic 1
} else if(condition2){
send message to topic 2
}
//and so on
Note that I have one single source of messages(ie., single String-stream) Below is the code that I am currently using.
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
CustomSourceFunction source = CustomSourceFunction.getInstance();
DataStream<String> stringStream = env.addSource(source);
FlinkKafkaProducer011<String> producer = getProducer();
stringStream.addSink(producer);
env.execute();
Is there a way to configure a no of sinks based on some conditions in apache-flink ? Also, how many sinks can be added to the same stream ?