Define API Topics.
Message(data, message_id, attributes=None)#
Messages can be published to a topic and received by subscribers.
- data (bytes) – the payload of the message
- message_id (string) – An ID assigned to the message by the API.
- attributes (dict or None) – Extra metadata associated by the publisher with the message.
Lazily-constructed attribute dictionary
Factory: construct message from API representation.
Parameters: api_repr (dict or None) – The API representation of the message
Return sortable timestamp from attributes, if passed.
Allows sorting messages in publication order (assuming consistent clocks across all publishers).
Returns: timestamp (in UTC timezone) parsed from RFC 3339 timestamp Raises: ValueError if timestamp not in
attributes, or if it does not match the RFC 3339 format.