Skip to main content
Version: dev 🚧

EventMetadata

fastkafka.EventMetadata​

View source

A class for encapsulating Kafka record metadata.

Parameters:

NameTypeDescriptionDefault
topicstrThe topic this record is received fromrequired
partitionintThe partition from which this record is receivedrequired
offsetintThe position of this record in the corresponding Kafka partitionrequired
timestampintThe timestamp of this recordrequired
timestamp_typeintThe timestamp type of this recordrequired
keyOptional[bytes]The key (or None if no key is specified)required
valueOptional[bytes]The valuerequired
serialized_key_sizeintThe size of the serialized, uncompressed key in bytesrequired
serialized_value_sizeintThe size of the serialized, uncompressed value in bytesrequired
headersSequence[Tuple[str, bytes]]The headersrequired

init​

__init__(
self,
topic,
partition,
offset,
timestamp,
timestamp_type,
key,
value,
checksum,
serialized_key_size,
serialized_value_size,
headers,
)

create_event_metadata​

View source
@staticmethod
create_event_metadata(
record
)

Creates an instance of EventMetadata from a ConsumerRecord.

Parameters:

NameTypeDescriptionDefault
recordConsumerRecordThe Kafka ConsumerRecord.required

Returns:

TypeDescription
EventMetadataThe created EventMetadata instance.