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 2020/06/05 06:41:52 UTC

[GitHub] [pulsar] Huanli-Meng commented on a change in pull request #7175: [doc] Clarify the impact of batch message in key_shared subscription

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



##########
File path: site2/docs/client-libraries-java.md
##########
@@ -608,6 +608,22 @@ consumer2 receives the follwoing information.
 ("key-4", "message-4-2")
 ```
 
+If batch enabled at the producer side, messages with different key may add to a batch by default. The broker will dispatch the batch to the consumer, so the default batch mechanism may break the Key_Shared subscription guaranteed message distribution semantics. The producer need to use the `KeyBasedBatcher`.

Review comment:
       ```suggestion
   If batching is enabled at the producer side, messages with different keys are added to a batch by default. The broker will dispatch the batch to the consumer, so the default batch mechanism may break the Key_Shared subscription guaranteed message distribution semantics. The producer needs to use the `KeyBasedBatcher`.
   ```

##########
File path: site2/docs/client-libraries-java.md
##########
@@ -608,6 +608,22 @@ consumer2 receives the follwoing information.
 ("key-4", "message-4-2")
 ```
 
+If batch enabled at the producer side, messages with different key may add to a batch by default. The broker will dispatch the batch to the consumer, so the default batch mechanism may break the Key_Shared subscription guaranteed message distribution semantics. The producer need to use the `KeyBasedBatcher`.
+
+```java
+Producer producer = client.newProducer()
+        .topic("my-topic")
+        .batcherBuilder(BatcherBuilder.KEY_BASED)
+        .create();
+```
+Or the producer can disable the message batch mechanism.

Review comment:
       ```suggestion
   Or the producer can disable batching.
   ```




----------------------------------------------------------------
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:
users@infra.apache.org