Anonymitaet commented on a change in pull request #13838:
URL: https://github.com/apache/pulsar/pull/13838#discussion_r788299243
##########
File path: site2/docs/concepts-messaging.md
##########
@@ -202,46 +214,66 @@
consumer.negativeAckRedeliveryBackoff(NegativeAckRedeliveryExponentialBackoff.bu
### Acknowledgement timeout
-If a message is not consumed successfully, and you want the broker to
redeliver this message automatically, then you can enable automatic redelivery
mechanism for unacknowledged messages. With automatic redelivery enabled, the
client tracks the unacknowledged messages within the entire `acktimeout` time
range, and sends a `redeliver unacknowledged messages` request to the broker
automatically when the acknowledgement timeout is specified.
+The acknowledgement timeout mechanism allows you to set a time range during
which the client tracks the unacknowledged messages. After this acknowledgement
timeout (`ackTimeout`) period, the client sends `redeliver unacknowledged
messages` request to the broker, thus the broker resends the unacknowledged
messages to the consumer.
+
+You can configure the acknowledgement timeout mechanism to redeliver the
message if it is not acknowledged after `ackTimeout` or to execute a timer task
to check the acknowledgement timeout messages during every `ackTimeoutTickTime`
period.
> **Note**
> - If batching is enabled, all messages in one batch are redelivered to the
> consumer.
-> - The negative acknowledgement is preferable over the acknowledgement
timeout, since negative acknowledgement controls the redelivery of individual
messages more precisely and avoids invalid redeliveries when the message
processing time exceeds the acknowledgement timeout.
+> - Compared with acknowledgement timeout, negative acknowledgement is
preferred. First, it is difficult to set a timeout value. Second, broker
resends messages when the message processing time exceeds the acknowledgement
timeout, but these messages might not need to be re-consumed.
Review comment:
```suggestion
> - Compared with acknowledgement timeout, negative acknowledgement is
preferred. First, it is difficult to set a timeout value. Second, a broker
resends messages when the message processing time exceeds the acknowledgement
timeout, but these messages might not need to be re-consumed.
```
##########
File path: site2/docs/concepts-messaging.md
##########
@@ -617,6 +649,22 @@ Producer<byte[]> producer = client.newProducer()
.create();
```
+## Message redelivery
+
+Apache Pulsar supports graceful failure handling and ensures critical data is
not lost. Software will always have unexpected conditions and at times messages
may not be delivered successfully. Therefore, it is important to have a
built-in mechanism that handles failure, particularly in asynchronous messaging
as highlighted in the following examples.
+
+- Consumers get disconnected from the database or the HTTP server. When this
happens, the database is temporarily offline while the consumer is writing the
data to it and the external HTTP server that the consumer calls is momentarily
unavailable.
Review comment:
```suggestion
- Consumers get disconnected from the database or the HTTP server. When this
happens, the database is temporarily offline while the consumer is writing the
data to it and the external HTTP server that the consumer calls are momentarily
unavailable.
```
##########
File path: site2/docs/concepts-messaging.md
##########
@@ -165,7 +165,7 @@ consumer.acknowledgeCumulative(msg);
### Negative acknowledgement
-When a consumer fails to consume a message and intends to consume it again,
this consumer should send a negative acknowledgement to the broker. Then, the
broker will redeliver this message to the consumer.
+The negative acknowledgement mechanism allows you to send a notification to
the broker indicating the consumer did not process a message. When a consumer
fails to consume a message and needs to re-consume it, the consumer sends a
negative acknowledgement (nack) to the broker, triggering the broker to
redeliver this message to the consumer.
Review comment:
```suggestion
The [negative acknowledgement](#negative-acknowledgement) mechanism allows
you to send a notification to the broker indicating the consumer did not
process a message. When a consumer fails to consume a message and needs to
re-consume it, the consumer sends a negative acknowledgement (nack) to the
broker, triggering the broker to redeliver this message to the consumer.
```
--
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]