ABCPublisher
faststream.rabbit.shared.publisher.ABCPublisher dataclass
#
ABCPublisher(queue: RabbitQueue = RabbitQueue(''), exchange: Optional[RabbitExchange] = None, _description: Optional[str] = None, virtual_host: str = '/', include_in_schema: bool = True, title: Optional[str] = None, _schema: Optional[Any] = None, _fake_handler: bool = False, routing_key: str = '', mandatory: bool = True, immediate: bool = False, persist: bool = False, timeout: TimeoutType = None, reply_to: Optional[str] = None, priority: Optional[int] = None, message_kwargs: AnyDict = dict())
Bases: ABC
, BasePublisher[MsgType]
, BaseRMQInformation
A class representing an ABCPublisher.
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 abstractmethod
async
#
publish(message: SendableMessage, correlation_id: Optional[str] = None, **kwargs: Any) -> Optional[SendableMessage]
Publish a message.
PARAMETER | DESCRIPTION |
---|---|
message | The message to be published. TYPE: |
correlation_id | Optional correlation ID for the message. |
**kwargs | Additional keyword arguments. TYPE: |
RETURNS | DESCRIPTION |
---|---|
Optional[SendableMessage] | The published message. |
RAISES | DESCRIPTION |
---|---|
NotImplementedError | If the method is not implemented. |
Source code in faststream/broker/publisher.py
reset_test #
schema #
Returns the schema of the API operation as a dictionary of channel names and channel objects.