Class DeadLetterPolicy.Builder (1.121.1)

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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public DeadLetterPolicy build()
Returns
TypeDescription
DeadLetterPolicy

buildPartial()

public DeadLetterPolicy buildPartial()
Returns
TypeDescription
DeadLetterPolicy

clear()

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

clearDeadLetterTopic()

public DeadLetterPolicy.Builder clearDeadLetterTopic()

The name of the topic to which dead letter messages should be published. Format is projects/{project}/topics/{topic}.The Cloud 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;

Returns
TypeDescription
DeadLetterPolicy.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearMaxDeliveryAttempts()

public DeadLetterPolicy.Builder clearMaxDeliveryAttempts()

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;

Returns
TypeDescription
DeadLetterPolicy.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

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

getDeadLetterTopic()

public String getDeadLetterTopic()

The name of the topic to which dead letter messages should be published. Format is projects/{project}/topics/{topic}.The Cloud 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;

Returns
TypeDescription
String

The deadLetterTopic.

getDeadLetterTopicBytes()

public ByteString getDeadLetterTopicBytes()

The name of the topic to which dead letter messages should be published. Format is projects/{project}/topics/{topic}.The Cloud 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;

Returns
TypeDescription
ByteString

The bytes for deadLetterTopic.

getDefaultInstanceForType()

public DeadLetterPolicy getDefaultInstanceForType()
Returns
TypeDescription
DeadLetterPolicy

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getMaxDeliveryAttempts()

public int getMaxDeliveryAttempts()

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;

Returns
TypeDescription
int

The maxDeliveryAttempts.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeFrom(DeadLetterPolicy other)

public DeadLetterPolicy.Builder mergeFrom(DeadLetterPolicy other)
Parameter
NameDescription
otherDeadLetterPolicy
Returns
TypeDescription
DeadLetterPolicy.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setDeadLetterTopic(String value)

public DeadLetterPolicy.Builder setDeadLetterTopic(String value)

The name of the topic to which dead letter messages should be published. Format is projects/{project}/topics/{topic}.The Cloud 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;

Parameter
NameDescription
valueString

The deadLetterTopic to set.

Returns
TypeDescription
DeadLetterPolicy.Builder

This builder for chaining.

setDeadLetterTopicBytes(ByteString value)

public DeadLetterPolicy.Builder setDeadLetterTopicBytes(ByteString value)

The name of the topic to which dead letter messages should be published. Format is projects/{project}/topics/{topic}.The Cloud 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;

Parameter
NameDescription
valueByteString

The bytes for deadLetterTopic to set.

Returns
TypeDescription
DeadLetterPolicy.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setMaxDeliveryAttempts(int value)

public DeadLetterPolicy.Builder setMaxDeliveryAttempts(int value)

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;

Parameter
NameDescription
valueint

The maxDeliveryAttempts to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
DeadLetterPolicy.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

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