AmqpAnnotatedMessage Class

The AMQP Annotated Message for advanced sending and receiving scenarios which allows you to access to low-level AMQP message sections. There should be one and only one of either data_body, sequence_body or value_body being set as the body of the AmqpAnnotatedMessage; if more than one body is set, ValueError will be raised. Please refer to the AMQP spec: http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#section-message-format for more information on the message format.

Inheritance
builtins.object
AmqpAnnotatedMessage

Constructor

AmqpAnnotatedMessage(*, header: AmqpMessageHeader | Mapping[str, Any] | None = None, footer: Dict[str, Any] | None = None, properties: AmqpMessageProperties | Mapping[str, Any] | None = None, application_properties: Dict[str, Any] | None = None, annotations: Dict[str, Any] | None = None, delivery_annotations: Dict[str, Any] | None = None, **kwargs: Any)

Keyword-Only Parameters

Name Description
data_body
str or bytes or list[str or bytes]

The body consists of one or more data sections and each section contains opaque binary data.

sequence_body

The body consists of one or more sequence sections and each section contains an arbitrary number of structured data elements.

value_body
any

The body consists of one amqp-value section and the section contains a single AMQP value.

header
AmqpMessageHeader or <xref:mapping>[str, any] or None

The amqp message header.

footer
dict or None

The amqp message footer.

properties
AmqpMessageProperties or <xref:mapping>[str, any] or None

Properties to add to the amqp message.

application_properties
dict or None

Service specific application properties.

annotations
dict or None

Service specific message annotations.

delivery_annotations
dict or None

Service specific delivery annotations.

Attributes

annotations

Service specific message annotations.

Returns

Type Description

application_properties

Service specific application properties.

Returns

Type Description

body

The body of the Message. The format may vary depending on the body type: For ~azure.servicebus.AmqpMessageBodyType.DATA, the body could be bytes or Iterable[bytes] For ~azure.servicebus.AmqpMessageBodyType.SEQUENCE, the body could be List or Iterable[List] For ~azure.servicebus.AmqpMessageBodyType.VALUE, the body could be any type. :rtype: Any

body_type

The body type of the underlying AMQP message. rtype: ~azure.servicebus.amqp.AmqpMessageBodyType

delivery_annotations

Delivery-specific non-standard properties at the head of the message. Delivery annotations convey information from the sending peer to the receiving peer.

Returns

Type Description

The message footer.

Returns

Type Description

header

The message header. :rtype: Optional[~azure.servicebus.amqp.AmqpMessageHeader]

properties

Properties to add to the message. :rtype: Optional[~azure.servicebus.amqp.AmqpMessageProperties]