Class: Google::Apis::PubsubV1::ReceivedMessage

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/pubsub_v1/classes.rb,
generated/google/apis/pubsub_v1/representations.rb,
generated/google/apis/pubsub_v1/representations.rb

Overview

A message and its corresponding acknowledgment ID.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ ReceivedMessage

Returns a new instance of ReceivedMessage.



903
904
905
# File 'generated/google/apis/pubsub_v1/classes.rb', line 903

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#ack_idString

This ID can be used to acknowledge the received message. Corresponds to the JSON property ackId

Returns:

  • (String)


872
873
874
# File 'generated/google/apis/pubsub_v1/classes.rb', line 872

def ack_id
  @ack_id
end

#delivery_attemptFixnum

Delivery attempt counter is 1 + (the sum of number of NACKs and number of ack_deadline exceeds) for this message. A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline exceeds event is whenever a message is not acknowledged within ack_deadline. Note that ack_deadline is initially Subscription.ackDeadlineSeconds, but may get extended automatically by the client library. The first delivery of a given message will have this value as 1. The value is calculated at best effort and is approximate. If a DeadLetterPolicy is not set on the subscription, this will be 0. EXPERIMENTAL: This feature is part of a closed alpha release. This API might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy. Corresponds to the JSON property deliveryAttempt

Returns:

  • (Fixnum)


889
890
891
# File 'generated/google/apis/pubsub_v1/classes.rb', line 889

def delivery_attempt
  @delivery_attempt
end

#messageGoogle::Apis::PubsubV1::Message

A message that is published by publishers and consumed by subscribers. The message must contain either a non-empty data field or at least one attribute. Note that client libraries represent this object differently depending on the language. See the corresponding client library documentation for more information. See Quotas and limits for more information about message limits. Corresponds to the JSON property message



901
902
903
# File 'generated/google/apis/pubsub_v1/classes.rb', line 901

def message
  @message
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



908
909
910
911
912
# File 'generated/google/apis/pubsub_v1/classes.rb', line 908

def update!(**args)
  @ack_id = args[:ack_id] if args.key?(:ack_id)
  @delivery_attempt = args[:delivery_attempt] if args.key?(:delivery_attempt)
  @message = args[:message] if args.key?(:message)
end