You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by "Tan, Min" <mi...@ubs.com> on 2021/06/21 10:58:31 UTC
Write Kafka message header using FlinkKafkaProducer
Hi,
I would like to add some meta data in the headers of kafka messages using FlinkKakfkaProducer.
I googled a bit and have not found an example.
Which Flink Serialization Schema should I use? Any suggestions?
Thank you very much for your help in advance.
Regards,
Min
Re: Write Kafka message header using FlinkKafkaProducer
Posted by Dawid Wysakowicz <dw...@apache.org>.
Hi,
You can use KafkaSerializationSchema[1] which can create a
ProducerRecord with Headers.
Best,
Dawid
[1]
https://ci.apache.org/projects/flink/flink-docs-release-1.13/api/java/org/apache/flink/streaming/connectors/kafka/KafkaSerializationSchema.html
On 21/06/2021 12:58, Tan, Min wrote:
>
> Hi,
>
>
>
> I would like to add some meta data in the headers of kafka
> messages using FlinkKakfkaProducer.
>
> I googled a bit and have not found an example.
>
> Which Flink Serialization Schema should I use? Any suggestions?
>
>
>
> Thank you very much for your help in advance.
>
>
>
> Regards,
>
> Min
>
>
>