LogicPublisher
faststream.rabbit.publisher.LogicPublisher dataclass
#
Bases: ABCPublisher[IncomingMessage]
A class to publish messages for logic processing.
METHOD | DESCRIPTION |
---|---|
publish | Publishes a message for logic processing. |
calls class-attribute
instance-attribute
#
exchange class-attribute
instance-attribute
#
exchange: Optional[RabbitExchange] = field(default=None)
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: float | None = 30.0,
raise_timeout: bool = False,
correlation_id: str | None = None,
priority: int | None = None,
**message_kwargs: Any
) -> 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. TYPE: |
raise_timeout | Whether to raise an exception if timeout occurs. TYPE: |
correlation_id | Correlation ID for the message. TYPE: |
priority | Priority for the message. TYPE: |
**message_kwargs | Additional keyword arguments for the message. TYPE: |
RETURNS | DESCRIPTION |
---|---|
ConfirmationFrameType | SendableMessage | ConfirmationFrameType or SendableMessage: The result of the publish operation. |
RAISES | DESCRIPTION |
---|---|
AssertionError | If |
Source code in faststream/rabbit/publisher.py
reset_test #
schema #
Returns the schema of the API operation as a dictionary of channel names and channel objects.