Class DeadLetterPolicy.Builder
java.lang.Object
org.apache.pulsar.client.api.v5.config.DeadLetterPolicy.Builder
- Enclosing class:
DeadLetterPolicy
Builder for
DeadLetterPolicy.-
Method Summary
Modifier and TypeMethodDescriptionbuild()deadLetterTopic(String deadLetterTopic) Custom dead letter topic.initialSubscriptionName(String initialSubscriptionName) Subscription name to create on the dead letter topic, ensuring messages forwarded to the DLQ are retained until consumed.maxRedeliverCount(int maxRedeliverCount) Maximum number of redelivery attempts before sending to the dead letter topic.retryLetterTopic(String retryLetterTopic) Custom retry letter topic.
-
Method Details
-
maxRedeliverCount
Maximum number of redelivery attempts before sending to the dead letter topic. Required.- Parameters:
maxRedeliverCount- the redelivery threshold- Returns:
- this builder
-
retryLetterTopic
Custom retry letter topic.null(default) auto-generates the name.- Parameters:
retryLetterTopic- the retry letter topic name- Returns:
- this builder
-
deadLetterTopic
Custom dead letter topic.null(default) auto-generates the name as<source>-DLQ.- Parameters:
deadLetterTopic- the dead letter topic name- Returns:
- this builder
-
initialSubscriptionName
Subscription name to create on the dead letter topic, ensuring messages forwarded to the DLQ are retained until consumed.- Parameters:
initialSubscriptionName- the DLQ initial subscription- Returns:
- this builder
-
build
- Returns:
- a new
DeadLetterPolicyinstance
-