I looked at the source code of the Deserializer and was not able to find a way to get the schema being used to deserialize the last record.
Which I find odd. Imagine the use cases where
- RecordNameStrategy is used
- TopicRecordNameStrategy is used
- the consumer has to do something when the schema id does change, e.g. new schema with an additional field was created, consumer must alter the target database and add this new column to the table.
In all these cases we get back a dict with the payload but no idea what schema this payload belonged to.
For the topic you can go back to the binary message object itself, at least. It contains topic, partition, offset.