PatchedMessage
faststream.nats.testing.PatchedMessage #
PatchedMessage(
_client: NATS,
subject: str = "",
reply: str = "",
data: bytes = b"",
headers: Optional[Dict[str, str]] = None,
_metadata: Optional[Metadata] = None,
_ackd: bool = False,
_sid: Optional[int] = None,
)
Bases: Msg
is_acked property #
is_acked: bool
Have we sent a terminal ack message (not in-progress) in response to this original message?
Ack #
Metadata dataclass #
Metadata(
sequence: SequencePair,
num_pending: int,
num_delivered: int,
timestamp: datetime,
stream: str,
consumer: str,
domain: Optional[str] = None,
)
Metadata is the metadata from a JetStream message.
- num_pending is the number of available messages in the Stream that have not been consumed yet.
- num_delivered is the number of times that this message has been delivered. For example, num_delivered higher than one means that there have been redeliveries.
- timestamp is the time at which the message was delivered.
- stream is the name of the stream.
- consumer is the name of the consumer.
ack async #
ack_sync async #
ack_sync(timeout: float = 1) -> PatchedMessage