pulsar-client-cpp
Loading...
Searching...
No Matches
Public Member Functions | List of all members
pulsar::DeadLetterPolicyBuilder Class Reference

#include <DeadLetterPolicyBuilder.h>

Public Member Functions

DeadLetterPolicyBuilderdeadLetterTopic (const std::string &deadLetterTopic)
 
DeadLetterPolicyBuildermaxRedeliverCount (int maxRedeliverCount)
 
DeadLetterPolicyBuilderinitialSubscriptionName (const std::string &initialSubscriptionName)
 
DeadLetterPolicy build ()
 

Detailed Description

The builder to build a DeadLetterPolicyBuilder

Example of building DeadLetterPolicy:

++
.deadLetterTopic("dlq-topic")
.initialSubscriptionName("init-sub-name")
.build();
Definition DeadLetterPolicyBuilder.h:44
DeadLetterPolicyBuilder & deadLetterTopic(const std::string &deadLetterTopic)
DeadLetterPolicyBuilder & initialSubscriptionName(const std::string &initialSubscriptionName)
DeadLetterPolicyBuilder & maxRedeliverCount(int maxRedeliverCount)
Definition DeadLetterPolicy.h:36

Member Function Documentation

◆ build()

DeadLetterPolicy pulsar::DeadLetterPolicyBuilder::build ( )

Build DeadLetterPolicy.

Returns

◆ deadLetterTopic()

DeadLetterPolicyBuilder & pulsar::DeadLetterPolicyBuilder::deadLetterTopic ( const std::string &  deadLetterTopic)

Set dead letter topic.

Parameters
deadLetterTopicName of the dead topic where the failing messages are sent. The default value is: sourceTopicName + "-" + subscriptionName + "-DLQ"
Returns

◆ initialSubscriptionName()

DeadLetterPolicyBuilder & pulsar::DeadLetterPolicyBuilder::initialSubscriptionName ( const std::string &  initialSubscriptionName)

Set initial subscription name

Parameters
initialSubscriptionNameName of the initial subscription name of the dead letter topic. If this field is not set, the initial subscription for the dead letter topic is not created. If this field is set but the broker's allowAutoSubscriptionCreation is disabled, the DLQ producer fails to be created.
Returns

◆ maxRedeliverCount()

DeadLetterPolicyBuilder & pulsar::DeadLetterPolicyBuilder::maxRedeliverCount ( int  maxRedeliverCount)

Set max redeliver count

Parameters
maxRedeliverCountMaximum number of times that a message is redelivered before being sent to the dead letter queue.
  • The maxRedeliverCount must be greater than 0.
  • The default value is {INT_MAX} (DLQ is not enabled)
Returns

The documentation for this class was generated from the following file: