Skip to main content

props_for

Function props_for 

Source
pub fn props_for(
    envelope: &Envelope,
    delay: Option<Duration>,
) -> 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 set only when delay is Some, and is the delay in whole milliseconds rounded up (see expiration_ms).