Package proton :: Class Message

[frames] | no frames]

# Class Message

source code

    object --+
             |
            Message

The Message class is a mutable holder of message content.

Instance Methods

__del__(self) | source code

__init__(self, body=None, **kwargs) x.__init__(...) initializes x; see help(type(x)) for signature | source code

__repr2__(self) | source code

__repr__(self) repr(x) | source code

clear(self) Clears the contents of the Message. | source code

decode(self, data) | source code

encode(self) | source code

recv(self, link) Receives and decodes the message content for the current delivery from the link. | source code

send(self, sender, tag=None) | source code

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables
| DEFAULT_PRIORITY = `4`

Instance Variables
dict | annotations infrastructure defined message annotations
bytes | unicode | dict | list | int | long | float | UUID | body message body
dict | instructions delivery instructions for the message
dict | properties application defined message properties

Properties
| address The address of the message.
| content_encoding The content-encoding of the message.
| content_type The content-type of the message.
| correlation_id The correlation-id for the message.
| creation_time The creation time of the message.
| delivery_count The number of delivery attempts made for this message.
| durable The durable property indicates that the message should be held durably by any intermediaries taking responsibility for the message.
| expiry_time The expiry time of the message.
| first_acquirer True iff the recipient is the first to acquire the message.
| group_id The group id of the message.
| group_sequence The sequence of the message within its group.
| id The id of the message.
| inferred The inferred flag for a message indicates how the message content is encoded into AMQP sections.
| priority The priority of the message.
| reply_to The reply-to address for the message.
| reply_to_group_id The group-id for any replies.
| subject The subject of the message.
| ttl The time to live of the message measured in seconds.
| user_id The user id of the message creator.
Inherited from `object`: `__class__`

Method Details

### __init__(self, body=None, **kwargs)
(Constructor)

source code

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  - `kwargs` - Message property name/value pairs to initialise the Message
Overrides: object.__init__

### __repr__(self)
(Representation operator)

source code

repr(x)

Overrides: object.__repr__
  (inherited documentation)

### clear(self)

source code

Clears the contents of the Message. All fields will be reset to their default values.

### recv(self, link)

source code

Receives and decodes the message content for the current delivery from the link. Upon success it will return the current delivery for the link. If there is no current delivery, or if the current delivery is incomplete, or if the link is not a receiver, it will return None.

Parameters:
  - `link` (Link) - the link to receive a message from @return the delivery associated with the decoded message (or None)

Property Details

### address

The address of the message.

Get Method:
  _get_address(self)
Set Method:
  _set_address(self, value)

### content_encoding

The content-encoding of the message.

Get Method:
  _get_content_encoding(self)
Set Method:
  _set_content_encoding(self, value)

### content_type

The content-type of the message.

Get Method:
  _get_content_type(self)
Set Method:
  _set_content_type(self, value)

### correlation_id

The correlation-id for the message.

Get Method:
  _get_correlation_id(self)
Set Method:
  _set_correlation_id(self, value)

### creation_time

The creation time of the message.

Get Method:
  _get_creation_time(self)
Set Method:
  _set_creation_time(self, value)

### delivery_count

The number of delivery attempts made for this message.

Get Method:
  _get_delivery_count(self)
Set Method:
  _set_delivery_count(self, value)

### durable

The durable property indicates that the message should be held durably by any intermediaries taking responsibility for the message.

Get Method:
  _is_durable(self)
Set Method:
  _set_durable(self, value)

### expiry_time

The expiry time of the message.

Get Method:
  _get_expiry_time(self)
Set Method:
  _set_expiry_time(self, value)

### first_acquirer

True iff the recipient is the first to acquire the message.

Get Method:
  _is_first_acquirer(self)
Set Method:
  _set_first_acquirer(self, value)

### group_id

The group id of the message.

Get Method:
  _get_group_id(self)
Set Method:
  _set_group_id(self, value)

### group_sequence

The sequence of the message within its group.

Get Method:
  _get_group_sequence(self)
Set Method:
  _set_group_sequence(self, value)

### id

The id of the message.

Get Method:
  _get_id(self)
Set Method:
  _set_id(self, value)

### inferred

The inferred flag for a message indicates how the message content is encoded into AMQP sections. If inferred is true then binary and list values in the body of the message will be encoded as AMQP DATA and AMQP SEQUENCE sections, respectively. If inferred is false, then all values in the body of the message will be encoded as AMQP VALUE sections regardless of their type.

Get Method:
  _is_inferred(self)
Set Method:
  _set_inferred(self, value)

### priority

The priority of the message.

Get Method:
  _get_priority(self)
Set Method:
  _set_priority(self, value)

### reply_to

The reply-to address for the message.

Get Method:
  _get_reply_to(self)
Set Method:
  _set_reply_to(self, value)

### reply_to_group_id

The group-id for any replies.

Get Method:
  _get_reply_to_group_id(self)
Set Method:
  _set_reply_to_group_id(self, value)

### subject

The subject of the message.

Get Method:
  _get_subject(self)
Set Method:
  _set_subject(self, value)

### ttl

The time to live of the message measured in seconds. Expired messages may be dropped.

Get Method:
  _get_ttl(self)
Set Method:
  _set_ttl(self, value)

### user_id

The user id of the message creator.

Get Method:
  _get_user_id(self)
Set Method:
  _set_user_id(self, value)