NatsPublisher
faststream.nats.broker.NatsPublisher #
NatsPublisher(
subject: str = "",
*,
headers: dict[str, str] | None = None,
reply_to: str = "",
stream: Union[str, JStream, None] = None,
timeout: float | None = None,
title: str | None = None,
description: str | None = None,
schema: Any | None = None,
include_in_schema: bool = True,
persistent: bool = True,
)
Bases: ArgsContainer
Delayed NatsPublisher registration object.
Just a copy of KafkaRegistrator.publisher(...) arguments.
Initialized the NatsPublisher object.
| PARAMETER | DESCRIPTION |
|---|---|
subject | NATS subject to send message. 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 | NATS subject name to send response. TYPE: |
stream | This option validates that the target TYPE: |
timeout | Timeout to send message to NATS. 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: |
Source code in faststream/nats/broker/router.py
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 | |