EventMetadata
fastkafka.EventMetadata​
A class for encapsulating Kafka record metadata.
Parameters:
topic: The topic this record is received frompartition: The partition from which this record is receivedoffset: The position of this record in the corresponding Kafka partitiontimestamp: The timestamp of this recordtimestamp_type: The timestamp type of this recordkey: The key (orNoneif no key is specified)value: The valueserialized_key_size: The size of the serialized, uncompressed key in bytesserialized_value_size: The size of the serialized, uncompressed value in bytesheaders: The headers
create_event_metadata​
def create_event_metadata(record: aiokafka.structs.ConsumerRecord) -> EventMetadata
Creates an instance of EventMetadata from a ConsumerRecord.
Parameters:
record: The Kafka ConsumerRecord.
Returns:
- The created EventMetadata instance.