Huanli-Meng commented on a change in pull request #9822:
URL: https://github.com/apache/pulsar/pull/9822#discussion_r589177060



##########
File path: pulsar-client-cpp/include/pulsar/ProducerConfiguration.h
##########
@@ -85,7 +85,17 @@ class PULSAR_PUBLIC ProducerConfiguration {
     ProducerConfiguration(const ProducerConfiguration&);
     ProducerConfiguration& operator=(const ProducerConfiguration&);
 
+    /**
+     * Set the producer name which could have been assigned by the system or 
specified by the client.

Review comment:
       ```suggestion
        * Set the producer name which could be assigned by the system or 
specified by the client.
   ```

##########
File path: pulsar-client-cpp/include/pulsar/ProducerConfiguration.h
##########
@@ -124,7 +134,20 @@ class PULSAR_PUBLIC ProducerConfiguration {
      */
     int getSendTimeout() const;
 
+    /**
+     * Set the baseline of the sequence ID for messages published by the 
producer.
+     * <p>
+     * First message uses (initialSequenceId + 1) as its sequence ID and 
subsequent messages are assigned

Review comment:
       ```suggestion
        * The first message uses (initialSequenceId + 1) as its sequence ID and 
subsequent messages are assigned
   ```

##########
File path: pulsar-client-cpp/include/pulsar/ProducerConfiguration.h
##########
@@ -185,29 +264,120 @@ class PULSAR_PUBLIC ProducerConfiguration {
     bool getBlockIfQueueFull() const;
 
     // Zero queue size feature will not be supported on consumer end if 
batching is enabled
+
+    /**
+     * Control whether automatic batching of messages is enabled or not for 
the producer. <i>Default value:
+     * false (no batching).</i>
+     *
+     * When batching is enabled, multiple calls to Producer::sendAsync can 
result in a single batch to be sent
+     * to the broker, leading to better throughput, especially when publishing 
small messages. If compression
+     * is enabled, messages are compressed at the batch level, leading to a 
much better compression ratio for
+     * similar headers or contents.
+     *
+     * When the default batch delay is set to 10 ms and the default batch size 
is 1000 messages.
+     *
+     * @see ProducerConfiguration::setBatchingMaxPublishDelayMs
+     *
+     */
     ProducerConfiguration& setBatchingEnabled(const bool& batchingEnabled);
+
+    /**
+     * Return the flag whether automatic message batching is enabled or not 
for the producer.

Review comment:
       automatic message batching, automatic batching, or batching. These 
should be consistent.

##########
File path: pulsar-client-cpp/include/pulsar/ProducerConfiguration.h
##########
@@ -159,18 +199,57 @@ class PULSAR_PUBLIC ProducerConfiguration {
     ProducerConfiguration& setMaxPendingMessagesAcrossPartitions(int 
maxPendingMessagesAcrossPartitions);
 
     /**
-     *
      * @return the maximum number of pending messages allowed across all the 
partitions
      */
     int getMaxPendingMessagesAcrossPartitions() const;
 
+    /**
+     * Set the message routing modes for partitioned topics.
+     *
+     * @param PartitionsRoutingMode partition routing mode.
+     * @return
+     */
     ProducerConfiguration& setPartitionsRoutingMode(const 
PartitionsRoutingMode& mode);
+
+    /**
+     * The getter associated with setPartitionsRoutingMode().
+     */
     PartitionsRoutingMode getPartitionsRoutingMode() const;
 
+    /**
+     * Set a custom message routing policy by passing an implementation of 
MessageRouter.
+     *
+     * @param messageRouter message router.
+     * @return
+     */
     ProducerConfiguration& setMessageRouter(const MessageRoutingPolicyPtr& 
router);
+
+    /**
+     * The getter associated with setMessageRouter().
+     */
     const MessageRoutingPolicyPtr& getMessageRouterPtr() const;
 
+    /** 
+     * Set the hashing scheme, which is a standard hashing function available 
when choosing the partition to
+     * use for a particular message.

Review comment:
       ```suggestion
        * for a particular message.
   ```

##########
File path: pulsar-client-cpp/include/pulsar/ProducerConfiguration.h
##########
@@ -185,29 +264,120 @@ class PULSAR_PUBLIC ProducerConfiguration {
     bool getBlockIfQueueFull() const;
 
     // Zero queue size feature will not be supported on consumer end if 
batching is enabled
+
+    /**
+     * Control whether automatic batching of messages is enabled or not for 
the producer. <i>Default value:
+     * false (no batching).</i>
+     *
+     * When batching is enabled, multiple calls to Producer::sendAsync can 
result in a single batch to be sent
+     * to the broker, leading to better throughput, especially when publishing 
small messages. If compression
+     * is enabled, messages are compressed at the batch level, leading to a 
much better compression ratio for
+     * similar headers or contents.
+     *
+     * When the default batch delay is set to 10 ms and the default batch size 
is 1000 messages.
+     *
+     * @see ProducerConfiguration::setBatchingMaxPublishDelayMs
+     *
+     */
     ProducerConfiguration& setBatchingEnabled(const bool& batchingEnabled);
+
+    /**
+     * Return the flag whether automatic message batching is enabled or not 
for the producer.
+     *
+     * @return true if automatic message batching is enabled. Otherwise it 
returns false.
+     * @since 2.0.0 <br>
+     *        It is enabled by default.
+     */
     const bool& getBatchingEnabled() const;
 
+    /**
+     * Set the max number of messages permitted in a batch. <i>Default value: 
1000.</i> If you set this option
+     * to a value greater than 1, messages are queued until this threshold is 
reached or batch interval has
+     * elapsed.
+     *
+     * All messages in a batch are published as
+     *      a single batch message. The consumer is delivered individual 
messages in the batch in the same

Review comment:
       The consumer is delivered with ... or The consumer delivers...
   
   same for the next 

##########
File path: pulsar-client-cpp/include/pulsar/ProducerConfiguration.h
##########
@@ -159,18 +199,57 @@ class PULSAR_PUBLIC ProducerConfiguration {
     ProducerConfiguration& setMaxPendingMessagesAcrossPartitions(int 
maxPendingMessagesAcrossPartitions);
 
     /**
-     *
      * @return the maximum number of pending messages allowed across all the 
partitions
      */
     int getMaxPendingMessagesAcrossPartitions() const;
 
+    /**
+     * Set the message routing modes for partitioned topics.
+     *
+     * @param PartitionsRoutingMode partition routing mode.
+     * @return
+     */
     ProducerConfiguration& setPartitionsRoutingMode(const 
PartitionsRoutingMode& mode);
+
+    /**
+     * The getter associated with setPartitionsRoutingMode().
+     */
     PartitionsRoutingMode getPartitionsRoutingMode() const;
 
+    /**
+     * Set a custom message routing policy by passing an implementation of 
MessageRouter.
+     *
+     * @param messageRouter message router.
+     * @return
+     */
     ProducerConfiguration& setMessageRouter(const MessageRoutingPolicyPtr& 
router);
+
+    /**
+     * The getter associated with setMessageRouter().
+     */
     const MessageRoutingPolicyPtr& getMessageRouterPtr() const;
 
+    /** 
+     * Set the hashing scheme, which is a standard hashing function available 
when choosing the partition to

Review comment:
       ```suggestion
        * Set the hashing scheme, which is a standard hashing function 
available when choosing the partition
   ```

##########
File path: pulsar-client-cpp/include/pulsar/ProducerConfiguration.h
##########
@@ -185,29 +264,120 @@ class PULSAR_PUBLIC ProducerConfiguration {
     bool getBlockIfQueueFull() const;
 
     // Zero queue size feature will not be supported on consumer end if 
batching is enabled
+
+    /**
+     * Control whether automatic batching of messages is enabled or not for 
the producer. <i>Default value:
+     * false (no batching).</i>

Review comment:
       ```suggestion
        * false (no automatic batching).</i>
   ```




----------------------------------------------------------------
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.

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


Reply via email to