Skip to content

DeliveryMode

DeliveryMode

Bases: IntEnum

Enum for specifying the message delivery mode.

Inherits from enum.IntEnum so members are usable wherever an integer is expected, including the wire encoder for pika.spec.BasicProperties.delivery_mode.

Attributes: Transient: The message is not written to disk and may be lost if the broker crashes. Persistent: The message is written to disk and will survive broker crashes.

Source code in pika/delivery_mode.py
class DeliveryMode(IntEnum):
    """
    Enum for specifying the message delivery mode.

    Inherits from `enum.IntEnum` so members are usable wherever an
    integer is expected, including the wire encoder for
    [`pika.spec.BasicProperties.delivery_mode`][pika.spec.BasicProperties.delivery_mode].

    Attributes:
        Transient: The message is not written to disk and may be lost if the
            broker crashes.
        Persistent: The message is written to disk and will survive broker
            crashes.
    """

    Transient = 1
    Persistent = 2

Persistent class-attribute instance-attribute

Persistent = 2

Transient class-attribute instance-attribute

Transient = 1