From 949c1c42efeb2d9be38c1dc5664b74608534d6bb Mon Sep 17 00:00:00 2001 From: Baodi Shi Date: Mon, 26 Dec 2022 16:29:58 +0800 Subject: [PATCH] Return config& --- include/pulsar/ConsumerConfiguration.h | 2 +- lib/ConsumerConfiguration.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/pulsar/ConsumerConfiguration.h b/include/pulsar/ConsumerConfiguration.h index 84db73a7..c7d0886e 100644 --- a/include/pulsar/ConsumerConfiguration.h +++ b/include/pulsar/ConsumerConfiguration.h @@ -394,7 +394,7 @@ class PULSAR_PUBLIC ConsumerConfiguration { * * @param subscriptionMode the subscription mode value */ - void setSubscriptionMode(SubscriptionMode subscriptionMode); + ConsumerConfiguration& setSubscriptionMode(SubscriptionMode subscriptionMode); /** * Get subscription mode. diff --git a/lib/ConsumerConfiguration.cc b/lib/ConsumerConfiguration.cc index ac1a143b..118986ed 100644 --- a/lib/ConsumerConfiguration.cc +++ b/lib/ConsumerConfiguration.cc @@ -287,8 +287,9 @@ const BatchReceivePolicy& ConsumerConfiguration::getBatchReceivePolicy() const { return impl_->batchReceivePolicy; } -void ConsumerConfiguration::setSubscriptionMode(SubscriptionMode subscriptionMode) { +ConsumerConfiguration& ConsumerConfiguration::setSubscriptionMode(SubscriptionMode subscriptionMode) { impl_->subscriptionMode = subscriptionMode; + return *this; } SubscriptionMode ConsumerConfiguration::getSubscriptionMode() const { return impl_->subscriptionMode; }