Encapsulates Kafka topic and partition with optional topic auto-creation
# Source: https://github.com/ag2ai/faststream | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
class TopicPartition:
"""A Kafka topic partition with its creation setting."""
__slots__ = (
"declare",
"partition",
"topic",
)
def __init__(
self,
topic: str,
partition: int = -1,
*,
declare: bool = True,
) -> None:
"""Initialize the Kafka topic partition.
Args:
topic: Kafka topic name.
partition: Partition number to assign.
declare: Whether to create the topic automatically or just connect to it.
Missing topics are not created and thei
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key