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() -> None
Source code in faststream/nats/testing.py
300 301 | |
ack_sync async #
ack_sync(timeout: float = 1) -> PatchedMessage
Source code in faststream/nats/testing.py
303 304 305 306 307 | |
nak async #
nak(delay: float | None = None) -> None
Source code in faststream/nats/testing.py
309 310 | |
term async #
term() -> None
Source code in faststream/nats/testing.py
312 313 | |
in_progress async #
in_progress() -> None
Source code in faststream/nats/testing.py
315 316 | |
respond async #
respond(data: bytes) -> None
respond replies to the inbox of the message if there is one.
Source code in nats/aio/msg.py
96 97 98 99 100 101 102 103 104 105 | |