pubsub.subscriber_message

Classes

SubscriberMessage

Functions

parse_publish_time(publish_time)

Module Contents

pubsub.subscriber_message.parse_publish_time(publish_time)
Parameters:

publish_time (str)

Return type:

datetime.datetime

class pubsub.subscriber_message.SubscriberMessage(ack_id, message_id, publish_time, data, attributes, delivery_attempt=None)
Parameters:
  • ack_id (str)

  • message_id (str)

  • publish_time (datetime.datetime)

  • data (bytes | None)

  • attributes (dict[str, Any] | None)

  • delivery_attempt (int | None)

ack_id
message_id
publish_time
data
attributes
delivery_attempt = None
force_ack_nack: bool | None = None
static from_repr(received_message)
Parameters:

received_message (dict[str, Any])

Return type:

SubscriberMessage

to_repr()
Return type:

dict[str, Any]

ack()

Forcibly mark a message as acked.

By default, we only ack a message if the callback returns without raising an exception. If this method has been called on the Message, we will instead ack it regardless of exception status.

Return type:

None

nack()

Forcibly mark a message as nacked.

By default, we only nack a message if the callback raises an exception. If this method has been called on the Message, we will instead nack it regardless of exception status, ie. including if it completes successfully.

Return type:

None