NatsRoute
faststream.nats.broker.NatsRoute
#
NatsRoute(
call,
subject,
publishers=(),
queue="",
pending_msgs_limit=None,
pending_bytes_limit=None,
max_msgs=0,
durable=None,
config=None,
ordered_consumer=False,
idle_heartbeat=None,
flow_control=None,
deliver_policy=None,
headers_only=None,
pull_sub=None,
kv_watch=None,
obj_watch=False,
inbox_prefix=INBOX_PREFIX,
ack_first=EMPTY,
stream=None,
dependencies=(),
parser=None,
decoder=None,
middlewares=(),
max_workers=None,
no_ack=EMPTY,
ack_policy=EMPTY,
no_reply=False,
title=None,
description=None,
include_in_schema=True,
)
Bases: SubscriberRoute
Class to store delayed NatsBroker subscriber registration.
Initialized NatsRoute.
PARAMETER | DESCRIPTION |
---|---|
call
|
Message handler function to wrap the same with
TYPE:
|
subject
|
NATS subject to subscribe.
TYPE:
|
publishers
|
Nats publishers to broadcast the handler result.
TYPE:
|
queue
|
Subscribers' NATS queue name. Subscribers with same queue name will be load balanced by the NATS server.
TYPE:
|
pending_msgs_limit
|
Limit of messages, considered by NATS server as possible to be delivered to the client without been answered.
TYPE:
|
pending_bytes_limit
|
The number of bytes, considered by NATS server as possible to be delivered to the client without been answered.
TYPE:
|
max_msgs
|
Consuming messages limiter. Automatically disconnect if reached.
TYPE:
|
durable
|
Name of the durable consumer to which the the subscription should be bound.
TYPE:
|
config
|
Configuration of JetStream consumer to be subscribed with.
TYPE:
|
ordered_consumer
|
Enable ordered consumer mode.
TYPE:
|
idle_heartbeat
|
Enable Heartbeats for a consumer to detect failures.
TYPE:
|
flow_control
|
Enable Flow Control for a consumer.
TYPE:
|
deliver_policy
|
Deliver Policy to be used for subscription.
TYPE:
|
headers_only
|
Should be message delivered without payload, only headers and metadata.
TYPE:
|
pull_sub
|
NATS Pull consumer parameters container. Should be used with
TYPE:
|
kv_watch
|
KeyValue watch parameters container.
TYPE:
|
obj_watch
|
ObjectStore watch parameters container.
TYPE:
|
inbox_prefix
|
Prefix for generating unique inboxes, subjects with that prefix and NUID.
TYPE:
|
ack_first
|
Whether to
TYPE:
|
stream
|
Subscribe to NATS Stream with
TYPE:
|
dependencies
|
Dependencies list (
TYPE:
|
parser
|
Parser to map original nats-py Msg to FastStream one.
TYPE:
|
decoder
|
Function to decode FastStream msg bytes body to python objects.
TYPE:
|
middlewares
|
Subscriber middlewares to wrap incoming message processing.
TYPE:
|
max_workers
|
Number of workers to process messages concurrently.
TYPE:
|
no_ack
|
Whether to disable FastStream auto acknowledgement logic or not.
TYPE:
|
ack_policy
|
Acknowledgment policy for subscriber.
TYPE:
|
no_reply
|
Whether to disable FastStream RPC and Reply To auto responses or not.
TYPE:
|
title
|
AsyncAPI subscriber object title.
TYPE:
|
description
|
AsyncAPI subscriber object description. "Uses decorated docstring as default.
TYPE:
|
include_in_schema
|
Whetever to include operation in AsyncAPI schema or not.
TYPE:
|
Source code in faststream/nats/broker/router.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
|