KafkaPublisher
faststream.confluent.KafkaPublisher #
KafkaPublisher(
topic: str,
*,
key: bytes | str | None = None,
partition: int | None = None,
headers: dict[str, str] | None = None,
reply_to: str = "",
batch: bool = False,
middlewares: Sequence[PublisherMiddleware] = (),
title: str | None = None,
description: str | None = None,
schema: Any | None = None,
include_in_schema: bool = True,
)
Bases: ArgsContainer
Delayed KafkaPublisher registration object.
Just a copy of KafkaRegistrator.publisher(...) arguments.
Initialize KafkaPublisher.
| PARAMETER | DESCRIPTION |
|---|---|
topic | Topic where the message will be published. TYPE: |
key | A key to associate with the message. Can be used to determine which partition to send the message to. If partition is |
partition | Specify a partition. If not set, the partition will be selected using the configured TYPE: |
headers | Message headers to store metainformation. content-type and correlation_id will be set automatically by framework anyway. Can be overridden by |
reply_to | Topic name to send response. TYPE: |
batch | Whether to send messages in batches or not. TYPE: |
middlewares | Publisher middlewares to wrap outgoing messages. TYPE: |
title | AsyncAPI publisher object title. TYPE: |
description | AsyncAPI publisher object description. TYPE: |
schema | AsyncAPI publishing message type. Should be any python-native object annotation or TYPE: |
include_in_schema | Whetever to include operation in AsyncAPI schema or not. TYPE: |