Skip to content

ConsumerRecord

aiokafka.structs.ConsumerRecord dataclass #

ConsumerRecord(
    topic: str,
    partition: int,
    offset: int,
    timestamp: int,
    timestamp_type: int,
    key: Optional[KT],
    value: Optional[VT],
    checksum: Optional[int],
    serialized_key_size: int,
    serialized_value_size: int,
    headers: Sequence[tuple[str, bytes]],
)

Bases: Generic[KT, VT]

topic instance-attribute #

topic: str

The topic this record is received from

partition instance-attribute #

partition: int

The partition from which this record is received

offset instance-attribute #

offset: int

The position of this record in the corresponding Kafka partition.

timestamp instance-attribute #

timestamp: int

The timestamp of this record

timestamp_type instance-attribute #

timestamp_type: int

The timestamp type of this record

key instance-attribute #

key: Optional[KT]

The key (or None if no key is specified)

value instance-attribute #

value: Optional[VT]

The value

checksum instance-attribute #

checksum: Optional[int]

Deprecated

serialized_key_size instance-attribute #

serialized_key_size: int

The size of the serialized, uncompressed key in bytes.

serialized_value_size instance-attribute #

serialized_value_size: int

The size of the serialized, uncompressed value in bytes.

headers instance-attribute #

headers: Sequence[tuple[str, bytes]]

The headers