Flink - Datastream type conversion - Error -


i'm trying write processed wordcount in flink kafka topic. error ---

"the method addsink(sinkfunction>) in type datastream> not applicable arguments (flinkkafkaproducer09)"

for code below -

datastream<tuple2<string, integer>> stream1 = stream.flatmap(new linesplitter())     .keyby(0).sum(1); stream1.print(); env.execute();  stream1.addsink(new flinkkafkaproducer09<string>("wcfktopic", new simplestringschema(),      properties)); env.execute(); 

thanks in advance!

the input type of sink function not match type of stream1.

try this:

new flinkkafkaproducer09<tuple2<string, integer>>(xxx); 

Comments