MessageHeader Class

The Message header. This is only used on received message, and not set on messages being sent. The properties set on any given message will depend on the Service and not all messages will have all properties.

Inheritance
builtins.object
MessageHeader

Constructor

MessageHeader(header=None)

Parameters

Name Description
header

Internal only. This is used to wrap an existing message header that has been received from an AMQP service.

default value: None

Variables

Name Description
delivery_count
int

The number of unsuccessful previous attempts to deliver this message. If this value is non-zero it can be taken as an indication that the delivery might be a duplicate. On first delivery, the value is zero. It is incremented upon an outcome being settled at the sender, according to rules defined for each outcome.

time_to_live
int

Duration in milliseconds for which the message is to be considered "live". If this is set then a message expiration time will be computed based on the time of arrival at an intermediary. Messages that live longer than their expiration time will be discarded (or dead lettered). When a message is transmitted by an intermediary that was received with a ttl, the transmitted message's header SHOULD contain a ttl that is computed as the difference between the current time and the formerly computed message expiration time, i.e., the reduced ttl, so that messages will eventually die if they end up in a delivery loop.

durable

Durable messages MUST NOT be lost even if an intermediary is unexpectedly terminated and restarted. A target which is not capable of fulfilling this guarantee MUST NOT accept messages where the durable header is set to True: if the source allows the rejected outcome then the message SHOULD be rejected with the precondition-failed error, otherwise the link MUST be detached by the receiver with the same error.

first_acquirer

If this value is True, then this message has not been acquired by any other link. If this value is False, then this message MAY have previously been acquired by another link or links.

priority
int

This field contains the relative message priority. Higher numbers indicate higher priority messages. Messages with higher priorities MAY be delivered before those with lower priorities.

Methods

get_header_obj

Get the underlying C reference from this object.

get_header_obj

Get the underlying C reference from this object.

get_header_obj()

Returns

Type Description

Attributes

ttl

Alias for time_to_live.

Returns

Type Description
int