RabbitMessage
faststream.rabbit.message.RabbitMessage dataclass
#
RabbitMessage(raw_message: Msg, body: Union[bytes, Any], decoded_body: Optional[DecodedMessage] = None, headers: AnyDict = dict(), path: AnyDict = dict(), content_type: Optional[str] = None, reply_to: str = '', message_id: str = lambda: str(uuid4())(), correlation_id: str = lambda: str(uuid4())())
Bases: StreamMessage[IncomingMessage]
A message class for working with RabbitMQ messages.
This class extends StreamMessage
to provide additional functionality for acknowledging, rejecting, or nack-ing RabbitMQ messages.
METHOD | DESCRIPTION |
---|---|
ack | Acknowledge the RabbitMQ message. |
nack | Negative Acknowledgment of the RabbitMQ message. |
reject | Reject the RabbitMQ message. |
correlation_id class-attribute
instance-attribute
#
message_id class-attribute
instance-attribute
#
ack async
#
ack(**kwargs: Any) -> None
Acknowledge the RabbitMQ message.
Acknowledgment indicates that the message has been successfully processed.
PARAMETER | DESCRIPTION |
---|---|
**kwargs | Additional keyword arguments (not used). TYPE: |
Source code in faststream/rabbit/message.py
nack async
#
nack(**kwargs: Any) -> None
Negative Acknowledgment of the RabbitMQ message.
Nack-ing a message indicates that the message processing has failed and should be requeued.
PARAMETER | DESCRIPTION |
---|---|
**kwargs | Additional keyword arguments (not used). TYPE: |
Source code in faststream/rabbit/message.py
reject async
#
reject(**kwargs: Any) -> None
Reject the RabbitMQ message.
Rejecting a message indicates that the message processing has failed, and it should not be requeued.
PARAMETER | DESCRIPTION |
---|---|
**kwargs | Additional keyword arguments (not used). TYPE: |