Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export interface ConsumerConfig {
deadLetterPolicy?: DeadLetterPolicy;
batchReceivePolicy?: ConsumerBatchReceivePolicy;
keySharedPolicy?: KeySharedPolicy;
replicateSubscriptionState?: boolean;
}

export class Consumer {
Expand Down
8 changes: 8 additions & 0 deletions src/ConsumerConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ static const std::string CFG_KEY_SHARED_POLICY_MODE = "keyShareMode";
static const std::string CFG_KEY_SHARED_POLICY_ALLOW_OUT_OF_ORDER = "allowOutOfOrderDelivery";
static const std::string CFG_KEY_SHARED_POLICY_STICKY_RANGES = "stickyRanges";
static const std::string CFG_CRYPTO_KEY_READER = "cryptoKeyReader";
static const std::string CFG_REPLICATE_SUBSCRIPTION_STATE = "replicateSubscriptionState";

static const std::map<std::string, pulsar_consumer_type> SUBSCRIPTION_TYPE = {
{"Exclusive", pulsar_ConsumerExclusive},
Expand Down Expand Up @@ -400,6 +401,13 @@ void ConsumerConfig::InitConfig(std::shared_ptr<ThreadSafeDeferred> deferred,
}
this->cConsumerConfig.get()->consumerConfiguration.setKeySharedPolicy(cppKeySharedPolicy);
}

if (consumerConfig.Has(CFG_REPLICATE_SUBSCRIPTION_STATE) &&
consumerConfig.Get(CFG_REPLICATE_SUBSCRIPTION_STATE).IsBoolean()) {
bool replicateSubscriptionState = consumerConfig.Get(CFG_REPLICATE_SUBSCRIPTION_STATE).ToBoolean();
this->cConsumerConfig.get()->consumerConfiguration.setReplicateSubscriptionStateEnabled(
replicateSubscriptionState);
}
}

ConsumerConfig::~ConsumerConfig() {
Expand Down
Loading