Class DeadLetterPolicy.Builder (1.129.3)

public static final class DeadLetterPolicy.Builder extends GeneratedMessageV3.Builder<DeadLetterPolicy.Builder> implements DeadLetterPolicyOrBuilder

Dead lettering is done on a best effort basis. The same message might be dead lettered multiple times.

If validation on any of the fields fails at subscription creation/updation, the create/update subscription request will fail.

Protobuf type google.pubsub.v1.DeadLetterPolicy

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public DeadLetterPolicy.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
DeadLetterPolicy.Builder
Overrides

build()

public DeadLetterPolicy build()
Returns
Type Description
DeadLetterPolicy

buildPartial()

public DeadLetterPolicy buildPartial()
Returns
Type Description
DeadLetterPolicy

clear()

public DeadLetterPolicy.Builder clear()
Returns
Type Description
DeadLetterPolicy.Builder
Overrides

clearDeadLetterTopic()

public DeadLetterPolicy.Builder clearDeadLetterTopic()

Optional. The name of the topic to which dead letter messages should be published. Format is projects/{project}/topics/{topic}.The Pub/Sub service account associated with the enclosing subscription's parent project (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have permission to Publish() to this topic.

The operation will fail if the topic does not exist. Users should ensure that there is a subscription attached to this topic since messages published to a topic with no subscriptions are lost.

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

Returns
Type Description
DeadLetterPolicy.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public DeadLetterPolicy.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
DeadLetterPolicy.Builder
Overrides

clearMaxDeliveryAttempts()

public DeadLetterPolicy.Builder clearMaxDeliveryAttempts()

Optional. The maximum number of delivery attempts for any message. The value must be between 5 and 100.

The number of delivery attempts is defined as 1 + (the sum of number of NACKs and number of times the acknowledgement deadline has been exceeded for the message).

A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that client libraries may automatically extend ack_deadlines.

This field will be honored on a best effort basis.

If this parameter is 0, a default value of 5 is used.

int32 max_delivery_attempts = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
DeadLetterPolicy.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public DeadLetterPolicy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
DeadLetterPolicy.Builder
Overrides

clone()

public DeadLetterPolicy.Builder clone()
Returns
Type Description
DeadLetterPolicy.Builder
Overrides

getDeadLetterTopic()

public String getDeadLetterTopic()

Optional. The name of the topic to which dead letter messages should be published. Format is projects/{project}/topics/{topic}.The Pub/Sub service account associated with the enclosing subscription's parent project (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have permission to Publish() to this topic.

The operation will fail if the topic does not exist. Users should ensure that there is a subscription attached to this topic since messages published to a topic with no subscriptions are lost.

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

Returns
Type Description
String

The deadLetterTopic.

getDeadLetterTopicBytes()

public ByteString getDeadLetterTopicBytes()

Optional. The name of the topic to which dead letter messages should be published. Format is projects/{project}/topics/{topic}.The Pub/Sub service account associated with the enclosing subscription's parent project (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have permission to Publish() to this topic.

The operation will fail if the topic does not exist. Users should ensure that there is a subscription attached to this topic since messages published to a topic with no subscriptions are lost.

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

Returns
Type Description
ByteString

The bytes for deadLetterTopic.

getDefaultInstanceForType()

public DeadLetterPolicy getDefaultInstanceForType()
Returns
Type Description
DeadLetterPolicy

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getMaxDeliveryAttempts()

public int getMaxDeliveryAttempts()

Optional. The maximum number of delivery attempts for any message. The value must be between 5 and 100.

The number of delivery attempts is defined as 1 + (the sum of number of NACKs and number of times the acknowledgement deadline has been exceeded for the message).

A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that client libraries may automatically extend ack_deadlines.

This field will be honored on a best effort basis.

If this parameter is 0, a default value of 5 is used.

int32 max_delivery_attempts = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The maxDeliveryAttempts.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public DeadLetterPolicy.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DeadLetterPolicy.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public DeadLetterPolicy.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
DeadLetterPolicy.Builder
Overrides

mergeFrom(DeadLetterPolicy other)

public DeadLetterPolicy.Builder mergeFrom(DeadLetterPolicy other)
Parameter
Name Description
other DeadLetterPolicy
Returns
Type Description
DeadLetterPolicy.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final DeadLetterPolicy.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
DeadLetterPolicy.Builder
Overrides

setDeadLetterTopic(String value)

public DeadLetterPolicy.Builder setDeadLetterTopic(String value)

Optional. The name of the topic to which dead letter messages should be published. Format is projects/{project}/topics/{topic}.The Pub/Sub service account associated with the enclosing subscription's parent project (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have permission to Publish() to this topic.

The operation will fail if the topic does not exist. Users should ensure that there is a subscription attached to this topic since messages published to a topic with no subscriptions are lost.

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

Parameter
Name Description
value String

The deadLetterTopic to set.

Returns
Type Description
DeadLetterPolicy.Builder

This builder for chaining.

setDeadLetterTopicBytes(ByteString value)

public DeadLetterPolicy.Builder setDeadLetterTopicBytes(ByteString value)

Optional. The name of the topic to which dead letter messages should be published. Format is projects/{project}/topics/{topic}.The Pub/Sub service account associated with the enclosing subscription's parent project (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have permission to Publish() to this topic.

The operation will fail if the topic does not exist. Users should ensure that there is a subscription attached to this topic since messages published to a topic with no subscriptions are lost.

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

Parameter
Name Description
value ByteString

The bytes for deadLetterTopic to set.

Returns
Type Description
DeadLetterPolicy.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public DeadLetterPolicy.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
DeadLetterPolicy.Builder
Overrides

setMaxDeliveryAttempts(int value)

public DeadLetterPolicy.Builder setMaxDeliveryAttempts(int value)

Optional. The maximum number of delivery attempts for any message. The value must be between 5 and 100.

The number of delivery attempts is defined as 1 + (the sum of number of NACKs and number of times the acknowledgement deadline has been exceeded for the message).

A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that client libraries may automatically extend ack_deadlines.

This field will be honored on a best effort basis.

If this parameter is 0, a default value of 5 is used.

int32 max_delivery_attempts = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value int

The maxDeliveryAttempts to set.

Returns
Type Description
DeadLetterPolicy.Builder

This builder for chaining.

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

public DeadLetterPolicy.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
DeadLetterPolicy.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final DeadLetterPolicy.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
DeadLetterPolicy.Builder
Overrides