TopicPartition
faststream.kafka.TopicPartition #
TopicPartition(
topic: str, partition: int = -1, *, declare: bool = True
)
A Kafka topic partition with its creation setting.
Initialize the Kafka topic partition.
| PARAMETER | DESCRIPTION |
|---|---|
topic | Kafka topic name. TYPE: |
partition | Partition number to assign. TYPE: |
declare | Whether to create the topic automatically or just connect to it. Missing topics are not created and their absence is not reported, so set it to TYPE: |
Source code in faststream/kafka/schemas/partition.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
add_prefix #
add_prefix(prefix: str) -> TopicPartition
Source code in faststream/kafka/schemas/partition.py
30 31 32 33 34 35 | |