ABCPublisher
faststream.kafka.shared.publisher.ABCPublisher dataclass
#
ABCPublisher(include_in_schema: bool = True, title: Optional[str] = None, _description: Optional[str] = None, _schema: Optional[Any] = None, _fake_handler: bool = False, topic: str = '', key: Optional[bytes] = None, partition: Optional[int] = None, timestamp_ms: Optional[int] = None, headers: Optional[Dict[str, str]] = None, reply_to: Optional[str] = '')
Bases: ABC
, BasePublisher[MsgType]
A class representing an ABCPublisher.
calls class-attribute
instance-attribute
#
include_in_schema 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.