BatchBuilder
faststream.confluent.client.BatchBuilder #
A helper class to build a batch of messages to send to Kafka.
Initializes a new BatchBuilder instance.
Source code in faststream/confluent/client.py
append #
append(*, timestamp: Optional[int] = None, key: Optional[Union[str, bytes]] = None, value: Optional[Union[str, bytes]] = None, headers: Optional[List[Tuple[str, bytes]]] = None) -> None
Appends a message to the batch with optional timestamp, key, value, and headers.
PARAMETER | DESCRIPTION |
---|---|
timestamp | The timestamp of the message. If None, current time is used. |
key | The key of the message. |
value | The value of the message. |
headers | A list of headers for the message. |
RAISES | DESCRIPTION |
---|---|
KafkaException | If both key and value are None. |