The EventData class is a container for event content.
ConstructorEventData(body: str | bytes | List | None = None)
Parameters Examples
Create instances of EventData
from azure.eventhub import EventData
event_data = EventData("String data")
event_data = EventData(b"Bytes data")
Methods body_as_json
The content of the event loaded as a JSON object, if the data is compatible.
body_as_json(encoding: str = 'UTF-8') -> Dict[str, Any]
Parameters Returns body_as_str
The content of the event as a string, if the data is of a compatible type.
body_as_str(encoding: str = 'UTF-8') -> str
Parameters Returns from_message_content
Creates an EventData object given content type and a content value to be set as body.
from_message_content(content: bytes, content_type: str, **kwargs: Any) -> EventData
Parameters Returns Attributes body
The body of the Message. The format may vary depending on the body type: For DATA, the body could be bytes or Iterable[bytes]. For SEQUENCE, the body could be List or Iterable[List]. For VALUE, the body could be any type.
Returns body_typeThe body type of the underlying AMQP message.
Returns content_typeThe content type descriptor. Optionally describes the payload of the message, with a descriptor following the format of RFC2045, Section 5, for example "application/json". :rtype: str or None
correlation_idThe correlation identifier. Allows an application to specify a context for the message for the purposes of correlation, for example reflecting the MessageId of a message that is being replied to. :rtype: str or None
enqueued_timeThe enqueued timestamp of the event.
Returns messageGet the underlying uamqp.Message or LegacyMessage. This is deprecated and will be removed in a later release.
Returns message_idThe id to identify the message. The message identifier is an application-defined value that uniquely identifies the message and its payload. The identifier is a free-form string and can reflect a GUID or an identifier derived from the application context. If enabled, the duplicate detection feature identifies and removes second and further submissions of messages with the same message id. :rtype: str or None
offsetThe offset of the event.
Returns partition_keyThe partition key of the event.
Returns propertiesApplication-defined properties on the event.
Returns raw_amqp_messageAdvanced usage only. The internal AMQP message payload that is sent or received.
Returns sequence_numberThe sequence number of the event.
Returns system_propertiesMetadata set by the Event Hubs Service associated with the event.
An EventData could have some or all of the following meta data depending on the source of the event data.
b"x-opt-sequence-number" (int)
b"x-opt-offset" (bytes)
b"x-opt-partition-key" (bytes)
b"x-opt-enqueued-time" (int)
b"message-id" (bytes)
b"user-id" (bytes)
b"to" (bytes)
b"subject" (bytes)
b"reply-to" (bytes)
b"correlation-id" (bytes)
b"content-type" (bytes)
b"content-encoding" (bytes)
b"absolute-expiry-time" (int)
b"creation-time" (int)
b"group-id" (bytes)
b"group-sequence" (bytes)
b"reply-to-group-id" (bytes)
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this articleWas this page helpful?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4