RabbitPublisher
faststream.rabbit.broker.RabbitPublisher
#
RabbitPublisher(
queue="",
exchange=None,
*,
routing_key="",
mandatory=True,
immediate=False,
timeout=None,
persist=False,
reply_to=None,
priority=None,
middlewares=(),
title=None,
description=None,
schema=None,
include_in_schema=True,
headers=None,
content_type=None,
content_encoding=None,
expiration=None,
message_type=None,
user_id=None,
)
Bases: ArgsContainer
Delayed RabbitPublisher registration object.
Just a copy of RabbitRegistrator.publisher(...)
arguments.
Initialized RabbitPublisher.
PARAMETER | DESCRIPTION |
---|---|
queue
|
Default message routing key to publish with.
Can be any
TYPE:
|
exchange
|
Target exchange to publish message to.
Any
TYPE:
|
routing_key
|
Default message routing key to publish with. Overrides
TYPE:
|
mandatory
|
Client waits for confirmation that the message is placed to some queue. RabbitMQ returns message to client if there is no suitable queue.
TYPE:
|
immediate
|
Client expects that there is consumer ready to take the message to work. RabbitMQ returns message to client if there is no suitable consumer.
TYPE:
|
timeout
|
Send confirmation time from RabbitMQ.
TYPE:
|
persist
|
Restore the message on RabbitMQ reboot.
TYPE:
|
reply_to
|
Reply message routing key to send with (always sending to default exchange).
TYPE:
|
priority
|
The message priority (0 by default).
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:
|
headers
|
Message headers to store metainformation. Can be overridden by
TYPE:
|
content_type
|
Message content-type header. Used by application, not core RabbitMQ. Will be set automatically if not specified.
TYPE:
|
content_encoding
|
Message body content encoding, e.g. gzip.
TYPE:
|
expiration
|
Message expiration (lifetime) in seconds (or datetime or timedelta).
TYPE:
|
message_type
|
Application-specific message type, e.g. orders.created.
TYPE:
|
user_id
|
Publisher connection User ID, validated if set.
TYPE:
|
Source code in faststream/rabbit/broker/router.py
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 92 93 94 95 96 97 98 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 |
|