MQTTPublishCommand
faststream.mqtt.response.MQTTPublishCommand #
MQTTPublishCommand(
message: SendableMessage,
*,
topic: str = "",
correlation_id: str | None = None,
headers: dict[str, str] | None = None,
reply_to: str = "",
qos: QoS = AT_MOST_ONCE,
retain: bool = False,
message_expiry_interval: int | None = None,
timeout: float | None = 30.0,
_publish_type: PublishType,
)
Bases: PublishCommand
Source code in faststream/mqtt/response.py
from_cmd classmethod #
from_cmd(
cmd: Union[PublishCommand, MQTTPublishCommand],
) -> MQTTPublishCommand
Source code in faststream/mqtt/response.py
as_publish_command #
as_publish_command() -> PublishCommand
Method to transform handlers' Response result to DTO for publishers.
Source code in faststream/response/response.py
get_publish_key #
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. |