toDlqRecord
fun DestinationRecordRaw.toDlqRecord(data: Map<String, Any>, keepOriginalFields: Boolean = true): DestinationRecordRaw
A helper method to modify a existing DestinationRecordRaw for a dead letter queue.
If keepOriginalFields is true, the data will be appended to the data blob. Otherwise, the data will replace the entire data blob of the record.
This method ensures we still track the correct metadata against the original record when it comes to stats and checkpointing while allowing a different content to be persisted to the dead letter queue.