pub struct RedisMessage { /* private fields */ }Expand description
A Redis Streams delivery, read from a consumer group via XREADGROUP or XAUTOCLAIM.
Settlement follows the republish-retry model: ack is XACK; nack(requeue = true)
re-appends a copy of the entry to the same stream and then acks the original (at-least-once,
so a duplicate is possible if the process crashes between the two); nack(requeue = false)
acks the original to drop it.
Implementations§
Trait Implementations§
Source§impl Debug for RedisMessage
impl Debug for RedisMessage
Source§impl IncomingMessage for RedisMessage
impl IncomingMessage for RedisMessage
Source§fn supports_nack_after(&self) -> bool
fn supports_nack_after(&self) -> bool
Native delayed redelivery is available only when the subscription opted into a durable ZSET
delay queue with RedisStream::delayed_retry; otherwise
the runtime applies its broker-agnostic deferred-republish fallback.
Source§async fn nack_after(self, delay: Duration) -> Result<(), AckError>
async fn nack_after(self, delay: Duration) -> Result<(), AckError>
Schedules the message for redelivery no sooner than delay from now via the configured ZSET
delay queue (ZADD the delayed copy, then XACK the original), with the retry-count header
incremented. The subscriber’s sweeper re-XADDs it to the source stream once due.
§Errors
Returns AckError::Unsupported when the subscription did not opt into a delay queue, or
AckError::Broker when the ZADD or XACK fails.
Source§async fn ack(self) -> Result<(), AckError>
async fn ack(self) -> Result<(), AckError>
Source§async fn nack(self, requeue: bool) -> Result<(), AckError>
async fn nack(self, requeue: bool) -> Result<(), AckError>
requeue is true the broker should
redeliver according to its own retry policy; when false it should drop or dead-letter
the message. Read moreSource§fn extensions(&self) -> Extensions
fn extensions(&self) -> Extensions
Source§impl Partitioned for RedisMessage
impl Partitioned for RedisMessage
Source§fn partition_key(&self) -> Option<&[u8]>
fn partition_key(&self) -> Option<&[u8]>
None if the broker should pick a partition.Auto Trait Implementations§
impl !Freeze for RedisMessage
impl !RefUnwindSafe for RedisMessage
impl !UnwindSafe for RedisMessage
impl Send for RedisMessage
impl Sync for RedisMessage
impl Unpin for RedisMessage
impl UnsafeUnpin for RedisMessage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more