'How to get the RecordMetadata of a produced message?

I want to access and log in my Flink application the RecordMetadata of the produced message. Is there somehow a possibly to get the offset/partition of the produced message with the usage of org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducer?



Solution 1:[1]

The RecordMetadata is logged on failures, but I don't believe it is possible (using Flink's public API) to register a callback for receiving it.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 David Anderson