How to write to Kafka Topic(Or to a file) from a Flink Stream

26 views Asked by At

I am using Flink Version, 1.18.0 and I would like to write my SingleOutputStreamOperator<Double> to either a Kafka Topic, or preferably a File but that somewhow seems more complicated so Kafka would be fine. This is the output of custom process function.

I have tried a few thing however this seems like a such a basic task that I dont think my code would be of any help.

Just in case, yes I do have Kafka running. I am even reading the data from a topic.

HI have tried to use ChatGpt and some tutorials but the API changes all the time so that has not been successfull. As I said I dont think my attempts are worth anyting.

Edit: I know that this does not work because of the no Argument RecordSerializer

 final var sinkRMSE = KafkaSink.<Double>builder()
                    .setBootstrapServers("localhost:9092")
                    .setDeliveryGuarantee(DeliveryGuarantee.NONE)
                    .setRecordSerializer( )
                    .build();

0

There are 0 answers