KafkaPublisher
faststream.confluent.broker.KafkaPublisher #
KafkaPublisher(
topic: Union[str, Topic],
*,
key: bytes | str | None = None,
partition: int | None = None,
headers: dict[str, str] | None = None,
reply_to: str = "",
batch: bool = False,
title: str | None = None,
description: str | None = None,
schema: Any | None = None,
include_in_schema: bool = True,
persistent: bool = True,
autoflush: bool = False,
)
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 TYPE: |
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 TYPE: |
reply_to | Topic name to send response. TYPE: |
batch | Whether to send messages in batches or not. 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: |
persistent | Whether to make the publisher persistent or not. TYPE: |
autoflush | Whether to flush the producer or not on every publish call. TYPE: |
Source code in faststream/confluent/broker/router.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |