Publisher
faststream.rabbit.asyncapi.Publisher #
Bases: LogicPublisher
A class representing a publisher.
| METHOD | DESCRIPTION |
|---|---|
get_payloads | Get the payloads for the publisher |
calls class-attribute instance-attribute #
exchange class-attribute instance-attribute #
include_in_schema class-attribute instance-attribute #
message_kwargs class-attribute instance-attribute #
mock class-attribute instance-attribute #
get_payloads #
Source code in faststream/broker/publisher.py
publish async #
publish(
message: AioPikaSendableMessage = "",
*,
rpc: bool = False,
rpc_timeout: Optional[float] = 30.0,
raise_timeout: bool = False,
correlation_id: Optional[str] = None,
priority: Optional[int] = None,
**message_kwargs: Any
) -> Union[
aiormq.abc.ConfirmationFrameType, SendableMessage
]
Publish a message.
| PARAMETER | DESCRIPTION |
|---|---|
message | The message to be published. TYPE: |
rpc | Whether the message is for RPC (Remote Procedure Call). TYPE: |
rpc_timeout | Timeout for RPC. |
raise_timeout | Whether to raise an exception if timeout occurs. TYPE: |
correlation_id | Correlation ID for the message. |
**message_kwargs | Additional keyword arguments for the message. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
Union[ConfirmationFrameType, SendableMessage] | ConfirmationFrameType or SendableMessage: The result of the publish operation. |
| RAISES | DESCRIPTION |
|---|---|
AssertionError | If |