EventMetadata
fastkafka.EventMetadata​
View sourceA class for encapsulating Kafka record metadata.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topic | str | The topic this record is received from | required |
partition | int | The partition from which this record is received | required |
offset | int | The position of this record in the corresponding Kafka partition | required |
timestamp | int | The timestamp of this record | required |
timestamp_type | int | The timestamp type of this record | required |
key | Optional[bytes] | The key (or None if no key is specified) | required |
value | Optional[bytes] | The value | required |
serialized_key_size | int | The size of the serialized, uncompressed key in bytes | required |
serialized_value_size | int | The size of the serialized, uncompressed value in bytes | required |
headers | Sequence[Tuple[str, bytes]] | The headers | required |
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:
Name | Type | Description | Default |
---|---|---|---|
record | ConsumerRecord | The Kafka ConsumerRecord. | required |
Returns:
Type | Description |
---|---|
EventMetadata | The created EventMetadata instance. |