pub struct LapinMessage { /* private fields */ }Expand description
One AMQP delivery, settled with the protocol’s native acknowledgement frames.
Settlement mapping:
acksendsbasic.ack.nack(true)sendsbasic.nackwithrequeue = true; the broker redelivers the message (typically to the same queue,redeliveredset).nack(false)sendsbasic.rejectwithrequeue = false; the broker drops the message, or dead-letters it when the queue has a dead-letter exchange.nack_after(delay)is native only when the subscription setRabbitQueue::delay; otherwise the default reports the delay unsupported and the runtime uses its broker-agnostic fallback.
Replies received through LapinRequester arrive on a no-ack
consumer; settling them is a no-op that always succeeds.
Implementations§
Source§impl LapinMessage
impl LapinMessage
Sourcepub fn exchange(&self) -> &str
pub fn exchange(&self) -> &str
The exchange this message was published to (empty for the default exchange).
Sourcepub fn routing_key(&self) -> &str
pub fn routing_key(&self) -> &str
The routing key the message was published with.
Sourcepub fn redelivered(&self) -> bool
pub fn redelivered(&self) -> bool
Whether the broker marked this delivery as redelivered.
Sourcepub fn delivery_tag(&self) -> u64
pub fn delivery_tag(&self) -> u64
The channel-local delivery tag of this delivery.
Trait Implementations§
Source§impl BuildContext<LapinMessage> for AmqpContext
impl BuildContext<LapinMessage> for AmqpContext
Source§fn build(msg: &LapinMessage) -> Self
fn build(msg: &LapinMessage) -> Self
msg.Source§impl Debug for LapinMessage
impl Debug for LapinMessage
Source§impl IncomingMessage for LapinMessage
impl IncomingMessage for LapinMessage
Source§async fn ack(self) -> Result<(), AckError>
async fn ack(self) -> Result<(), AckError>
Acknowledges the delivery with basic.ack.
§Errors
Returns AckError::Broker when the frame cannot be sent, for example because the
channel closed after the delivery arrived.
§Cancel safety
Not cancel safe: dropping the future after the frame was queued may still acknowledge the message on the broker.
Source§async fn nack(self, requeue: bool) -> Result<(), AckError>
async fn nack(self, requeue: bool) -> Result<(), AckError>
Settles negatively: basic.nack(requeue = true) or basic.reject(requeue = false).
§Errors
Returns AckError::Broker when the frame cannot be sent, for example because the
channel closed after the delivery arrived.
§Cancel safety
Not cancel safe: dropping the future after the frame was queued may still settle the message on the broker.
Source§fn partition_key(&self) -> Option<&[u8]>
fn partition_key(&self) -> Option<&[u8]>
The partition key from the PARTITION_KEY_HEADER, if set. Overridden so keyed worker
lanes see it without a Partitioned bound on every dispatch path.
Source§fn supports_nack_after(&self) -> bool
fn supports_nack_after(&self) -> bool
Whether this delivery can honor a native delayed redelivery.
true only when the subscription set RabbitQueue::delay;
otherwise the runtime uses its broker-agnostic deferred re-publish.
Source§async fn nack_after(self, delay: Duration) -> Result<(), AckError>
async fn nack_after(self, delay: Duration) -> Result<(), AckError>
Redelivers this message no sooner than delay, natively: re-publish it to the delay
waiting queue with a per-message TTL, then acknowledge the original. The waiting queue
dead-letters the copy back to the origin queue when the TTL fires.
Duplicate-not-loss: the re-publish is sent on the same channel before the original is acked, so a connection failure between them leaves the original unacked (redelivered), not lost. The one loss window is a missing waiting queue - an unroutable publish to the default exchange is silently dropped - which is why the waiting queue is the user’s declared infrastructure.
§Errors
Returns AckError::Unsupported when the subscription set no delay queue, and
AckError::Broker when the re-publish or the ack fails.
§Cancel safety
Not cancel safe: dropping the future may leave the delayed copy published, the original acked, or both.
Source§impl Partitioned for LapinMessage
impl Partitioned for LapinMessage
Source§fn partition_key(&self) -> Option<&[u8]>
fn partition_key(&self) -> Option<&[u8]>
The partition key from the PARTITION_KEY_HEADER, or None when unset.
Deliveries that share a key are dispatched to the same worker lane under
workers(n, by_key); AMQP itself does not interpret the
header, so the producer sets it.