Skip to main content

props_for

Function props_for 

Source
pub fn props_for(envelope: &Envelope) -> BasicProperties
Expand description

AMQP properties for publishing envelope.

  • content-type is application/json, matching Envelope::to_bytes.
  • delivery-mode is 2 (persistent).
  • message-id is the job id, stable across retries.
  • type is the job type.
  • priority is Envelope::priority, always set. Normal work carries 0; a deferred envelope carries its queue’s top level so it overtakes the backlog. A queue declared without x-max-priority ignores the property, and a priority above the queue’s x-max-priority is treated by the broker as that maximum, so this is safe to set unconditionally.
  • expiration is never set, not even for a message bound for a hold queue. The wait is the hold queue’s queue-wide x-message-ttl; a per-message expiration on top of it would reintroduce exactly the mixed-TTL head-of-line blocking that hold queues exist to avoid, and a shorter one would release the job early.