RabbitPublishCommand
faststream.rabbit.RabbitPublishCommand #
RabbitPublishCommand(
message: AioPikaSendableMessage,
*,
_publish_type: PublishType,
routing_key: str = "",
exchange: RabbitExchange | None = None,
mandatory: bool = True,
immediate: bool = False,
timeout: TimeoutType = None,
**message_options: Unpack[MessageOptions],
)
Bases: PublishCommand
Source code in faststream/rabbit/response.py
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 | |
publish_options instance-attribute #
publish_options: PublishOptions = {
"mandatory": mandatory,
"immediate": immediate,
}
as_publish_command #
as_publish_command() -> PublishCommand
Method to transform handlers' Response result to DTO for publishers.
Source code in faststream/response/response.py
22 23 24 25 26 27 28 29 | |
get_publish_key #
get_publish_key() -> Any | None
Get the key for publishing this message.
Override this method in subclasses to provide broker-specific keys. Default implementation returns None (no key).
| RETURNS | DESCRIPTION |
|---|---|
Any | None | The key for publishing, or None if this Response type doesn't use keys. |
Source code in faststream/response/response.py
31 32 33 34 35 36 37 38 39 40 | |
add_headers #
add_headers(
headers: dict[str, Any], *, override: bool = True
) -> None
Source code in faststream/response/response.py
71 72 73 74 75 76 77 78 79 80 | |
from_cmd classmethod #
from_cmd(
cmd: Union[PublishCommand, RabbitPublishCommand],
) -> RabbitPublishCommand
Source code in faststream/rabbit/response.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |