Class ReceivedMessage.Builder (1.126.6)

public static final class ReceivedMessage.Builder extends GeneratedMessageV3.Builder<ReceivedMessage.Builder> implements ReceivedMessageOrBuilder

A message and its corresponding acknowledgment ID.

Protobuf type google.pubsub.v1.ReceivedMessage

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ReceivedMessage.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
ReceivedMessage.Builder
Overrides

build()

public ReceivedMessage build()
Returns
TypeDescription
ReceivedMessage

buildPartial()

public ReceivedMessage buildPartial()
Returns
TypeDescription
ReceivedMessage

clear()

public ReceivedMessage.Builder clear()
Returns
TypeDescription
ReceivedMessage.Builder
Overrides

clearAckId()

public ReceivedMessage.Builder clearAckId()

Optional. This ID can be used to acknowledge the received message.

string ack_id = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ReceivedMessage.Builder

This builder for chaining.

clearDeliveryAttempt()

public ReceivedMessage.Builder clearDeliveryAttempt()

Optional. The approximate number of times that Pub/Sub has attempted to deliver the associated message to a subscriber.

More precisely, this is 1 + (number of NACKs) + (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.

Upon the first delivery of a given message, delivery_attempt will have a value of 1. The value is calculated at best effort and is approximate.

If a DeadLetterPolicy is not set on the subscription, this will be 0.

int32 delivery_attempt = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ReceivedMessage.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public ReceivedMessage.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
ReceivedMessage.Builder
Overrides

clearMessage()

public ReceivedMessage.Builder clearMessage()

Optional. The message.

.google.pubsub.v1.PubsubMessage message = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ReceivedMessage.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public ReceivedMessage.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
ReceivedMessage.Builder
Overrides

clone()

public ReceivedMessage.Builder clone()
Returns
TypeDescription
ReceivedMessage.Builder
Overrides

getAckId()

public String getAckId()

Optional. This ID can be used to acknowledge the received message.

string ack_id = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
String

The ackId.

getAckIdBytes()

public ByteString getAckIdBytes()

Optional. This ID can be used to acknowledge the received message.

string ack_id = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ByteString

The bytes for ackId.

getDefaultInstanceForType()

public ReceivedMessage getDefaultInstanceForType()
Returns
TypeDescription
ReceivedMessage

getDeliveryAttempt()

public int getDeliveryAttempt()

Optional. The approximate number of times that Pub/Sub has attempted to deliver the associated message to a subscriber.

More precisely, this is 1 + (number of NACKs) + (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.

Upon the first delivery of a given message, delivery_attempt will have a value of 1. The value is calculated at best effort and is approximate.

If a DeadLetterPolicy is not set on the subscription, this will be 0.

int32 delivery_attempt = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

The deliveryAttempt.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getMessage()

public PubsubMessage getMessage()

Optional. The message.

.google.pubsub.v1.PubsubMessage message = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
PubsubMessage

The message.

getMessageBuilder()

public PubsubMessage.Builder getMessageBuilder()

Optional. The message.

.google.pubsub.v1.PubsubMessage message = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
PubsubMessage.Builder

getMessageOrBuilder()

public PubsubMessageOrBuilder getMessageOrBuilder()

Optional. The message.

.google.pubsub.v1.PubsubMessage message = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
PubsubMessageOrBuilder

hasMessage()

public boolean hasMessage()

Optional. The message.

.google.pubsub.v1.PubsubMessage message = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
boolean

Whether the message field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ReceivedMessage.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ReceivedMessage.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public ReceivedMessage.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
ReceivedMessage.Builder
Overrides

mergeFrom(ReceivedMessage other)

public ReceivedMessage.Builder mergeFrom(ReceivedMessage other)
Parameter
NameDescription
otherReceivedMessage
Returns
TypeDescription
ReceivedMessage.Builder

mergeMessage(PubsubMessage value)

public ReceivedMessage.Builder mergeMessage(PubsubMessage value)

Optional. The message.

.google.pubsub.v1.PubsubMessage message = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuePubsubMessage
Returns
TypeDescription
ReceivedMessage.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ReceivedMessage.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ReceivedMessage.Builder
Overrides

setAckId(String value)

public ReceivedMessage.Builder setAckId(String value)

Optional. This ID can be used to acknowledge the received message.

string ack_id = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueString

The ackId to set.

Returns
TypeDescription
ReceivedMessage.Builder

This builder for chaining.

setAckIdBytes(ByteString value)

public ReceivedMessage.Builder setAckIdBytes(ByteString value)

Optional. This ID can be used to acknowledge the received message.

string ack_id = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueByteString

The bytes for ackId to set.

Returns
TypeDescription
ReceivedMessage.Builder

This builder for chaining.

setDeliveryAttempt(int value)

public ReceivedMessage.Builder setDeliveryAttempt(int value)

Optional. The approximate number of times that Pub/Sub has attempted to deliver the associated message to a subscriber.

More precisely, this is 1 + (number of NACKs) + (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.

Upon the first delivery of a given message, delivery_attempt will have a value of 1. The value is calculated at best effort and is approximate.

If a DeadLetterPolicy is not set on the subscription, this will be 0.

int32 delivery_attempt = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueint

The deliveryAttempt to set.

Returns
TypeDescription
ReceivedMessage.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public ReceivedMessage.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
ReceivedMessage.Builder
Overrides

setMessage(PubsubMessage value)

public ReceivedMessage.Builder setMessage(PubsubMessage value)

Optional. The message.

.google.pubsub.v1.PubsubMessage message = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuePubsubMessage
Returns
TypeDescription
ReceivedMessage.Builder

setMessage(PubsubMessage.Builder builderForValue)

public ReceivedMessage.Builder setMessage(PubsubMessage.Builder builderForValue)

Optional. The message.

.google.pubsub.v1.PubsubMessage message = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
builderForValuePubsubMessage.Builder
Returns
TypeDescription
ReceivedMessage.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public ReceivedMessage.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
ReceivedMessage.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final ReceivedMessage.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ReceivedMessage.Builder
Overrides