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/07/01 02:54:51 UTC
[GitHub] [pulsar] Anonymitaet commented on a change in pull request #11166: Add a call ACK / unack example to avoid confusing the retrial mechaniā¦
Anonymitaet commented on a change in pull request #11166:
URL: https://github.com/apache/pulsar/pull/11166#discussion_r661934592
##########
File path: site2/docs/concepts-messaging.md
##########
@@ -149,6 +149,17 @@ Messages can be acknowledged in the following two ways:
- Messages are acknowledged individually. With individual acknowledgement, the consumer needs to acknowledge each message and sends an acknowledgement request to the broker.
- Messages are acknowledged cumulatively. With cumulative acknowledgement, the consumer only needs to acknowledge the last message it received. All messages in the stream up to (and including) the provided message are not re-delivered to that consumer.
+The following example shows how to call the API With individual acknowledgement:
Review comment:
```suggestion
If you want to acknowledge messages individually, you can use the following API.
```
Pls keep consistent overall
##########
File path: site2/docs/concepts-messaging.md
##########
@@ -149,6 +149,17 @@ Messages can be acknowledged in the following two ways:
- Messages are acknowledged individually. With individual acknowledgement, the consumer needs to acknowledge each message and sends an acknowledgement request to the broker.
- Messages are acknowledged cumulatively. With cumulative acknowledgement, the consumer only needs to acknowledge the last message it received. All messages in the stream up to (and including) the provided message are not re-delivered to that consumer.
+The following example shows how to call the API With individual acknowledgement:
+
+```java
+consumer.acknowledge(msg);
+```
+If you are going to acknowledge messages cumulatively, you can use the following API:
Review comment:
```suggestion
If you want to acknowledge messages cumulatively, you can use the following API.
```
##########
File path: site2/docs/concepts-messaging.md
##########
@@ -242,6 +260,14 @@ Consumer<byte[]> consumer = pulsarClient.newConsumer(Schema.BYTES)
.subscribe();
```
+The following example shows how to call the API to put messages into the retrial queue:
Review comment:
```suggestion
If you want to put messages into a retrial queue, you can use the following API.
```
##########
File path: site2/docs/concepts-messaging.md
##########
@@ -164,6 +175,13 @@ In the shared and Key_Shared subscription modes, you can negatively acknowledge
Be aware that negative acknowledgment on ordered subscription types, such as Exclusive, Failover and Key_Shared, can cause failed messages to arrive consumers out of the original order.
+The following example shows how to call the API :
Review comment:
```suggestion
If you want to acknowledge messages negatively, you can use the following API.
```
--
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