You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/11/05 16:35:01 UTC

[GitHub] [pulsar] massakam commented on a change in pull request #12641: [cli] Enable CLI to publish non-batched messages

massakam commented on a change in pull request #12641:
URL: https://github.com/apache/pulsar/pull/12641#discussion_r743813991



##########
File path: pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/CmdProduce.java
##########
@@ -107,6 +107,9 @@
                description = "Rate (in msg/sec) at which to produce," +
                        " value 0 means to produce messages as fast as possible.")
     private double publishRate = 0;
+
+    @Parameter(names = { "-db", "--disable-batching" }, description = "Disable batch sending of messages")

Review comment:
       Normally, boolean type options do not require a value, so the default value should be false.
   ```sh
   # By default batching is enabled
   $ ./bin/pulsar-client produce -m hello persistent://public/default/t1
   
   # Batching is enabled in this case as well
   $ ./bin/pulsar-client produce -m hello --batch-enabled persistent://public/default/t1
   ```
   
   We can set the default value to true by specifying `arity = 1`, but it may be a bit verbose. 
   https://jcommander.org/#_boolean
   ```sh
   # Batching is enabled
   $ ./bin/pulsar-client produce -m hello --batch-enabled true persistent://public/default/t1
   
   # Batching is disabled
   $ ./bin/pulsar-client produce -m hello --batch-enabled false persistent://public/default/t1
   ```




-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org