QueueMessage Class

A Queue message object.

Inheritance
azure.functions._abc.QueueMessage
QueueMessage

Constructor

QueueMessage(*, id: typing.Union[str, NoneType] = None, body: typing.Union[str, bytes, NoneType] = None, pop_receipt: typing.Union[str, NoneType] = None) -> None

Parameters

id
str
Required

An optional string specifying the ID of the message.

body
Required

A string or bytes instance specifying the message body.

pop_receipt
str
Required

An optional string containing the pop receipt token.

Methods

get_body

Return message content as bytes.

get_json

Decode and return message content as a JSON object.

get_body

Return message content as bytes.

get_body() -> bytes

get_json

Decode and return message content as a JSON object.

get_json() -> typing.Any

Returns

Decoded JSON data.

Exceptions

when the body of the message does not contain valid JSON data.

Attributes

dequeue_count

The number of times this message has been dequeued.

expiration_time

A datetime object with the message expiry time.

id

Message ID.

insertion_time

A datetime object with the message queue insertion time.

pop_receipt

The message pop receipt token as a string.

time_next_visible

A datetime object with the time the message will be visible next.