BewareMyPower commented on code in PR #139:
URL: https://github.com/apache/pulsar-client-cpp/pull/139#discussion_r1071952441


##########
lib/ProducerConfigurationImpl.h:
##########
@@ -50,6 +50,20 @@ struct ProducerConfigurationImpl {
     std::map<std::string, std::string> properties;
     bool chunkingEnabled{false};
     ProducerConfiguration::ProducerAccessMode 
accessMode{ProducerConfiguration::Shared};
+    std::string initialSubscriptionName;
+
+    /**
+     * Use this config to automatically create an initial subscription when 
creating the topic.
+     * If this field is not set, the initial subscription will not be created.
+     * This method is limited to internal use
+     *
+     * @param initialSubscriptionName Name of the initial subscription of the 
topic.
+     */
+    void setInitialSubscriptionName(const std::string& 
initialSubscriptionNameParam) {
+        initialSubscriptionName = initialSubscriptionNameParam;
+    }
+
+    const std::string& getInitialSubscriptionName() const { return 
initialSubscriptionName; }

Review Comment:
   It's better not to add a setter and getter to a POD class. 
`initialSubscriptionName` is a public field, we can modify it directly. Adding 
a getter and setter to a POD class is redundant and adds much more code.



##########
lib/ProducerConfiguration.cc:
##########
@@ -16,6 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+#include "pulsar/ProducerConfiguration.h"

Review Comment:
   ```suggestion
   #include <pulsar/ProducerConfiguration.h>
   ```
   
   We usually use `<>` for headers of the Pulsar client itself.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to