共用方式為


AmqpAnnotatedMessage 類別

適用于進階傳送和接收案例的 AMQP 批註訊息,可讓您存取低階 AMQP 訊息區段。 應該有一個且只有一個data_body、sequence_body或value_body設定為 AmqpAnnotatedMessage 的主體;如果已設定多個主體,則會引發 ValueError 。 如需訊息格式的詳細資訊, http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#section-message-format 請參閱 AMQP 規格。

繼承
builtins.object
AmqpAnnotatedMessage

建構函式

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)

僅限關鍵字參數

名稱 Description
data_body
strbyteslist[strbytes]

本文包含一或多個資料區段,而每個區段則包含不透明的二進位資料。

sequence_body

本文包含一或多個序列區段,而每個區段包含任意數目的結構化資料元素。

value_body
any

本文包含一個 amqp-value 區段,而 區段包含單一 AMQP 值。

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

amqp 訊息標頭。

footer
dictNone

amqp 訊息頁尾。

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

要新增至 amqp 訊息的屬性。

application_properties
dictNone

服務特定的應用程式屬性。

annotations
dictNone

服務特定的訊息批註。

delivery_annotations
dictNone

服務特定的傳遞批註。

屬性

annotations

服務特定的訊息批註。

傳回

類型 Description

application_properties

服務特定的應用程式屬性。

傳回

類型 Description

body

訊息的本文。 格式可能會因本文類型而有所不同:針對 ~azure.servicebus.AmqpMessageBodyType.DATA,本文可以是位元組或 Iterable[bytes] 針對 ~azure.servicebus.AmqpMessageBodyType.SEQUENCE,本文可以是 List 或 Iterable[List] 針對 ~azure.servicebus.AmqpMessageBodyType.VALUE,本文可以是任何類型的。 :rtype: Any

body_type

基礎 AMQP 訊息的本文類型。 rtype: ~azure.servicebus.amqp.AmqpMessageBodyType

delivery_annotations

訊息前端的傳遞特定非標準屬性。 傳遞批註會將來自傳送對等的資訊傳遞給接收端對等。

傳回

類型 Description

訊息頁尾。

傳回

類型 Description

header

訊息標頭。 :rtype: Optional[~azure.servicebus.amqp.AmqpMessageHeader]

properties

要新增至訊息的屬性。 :rtype: Optional[~azure.servicebus.amqp.AmqpMessageProperties]