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/06/14 07:56:35 UTC

[GitHub] [pulsar] lhotari commented on issue #10890: The consumer receives the same message again after executing the acknowledge interface

lhotari commented on issue #10890:
URL: https://github.com/apache/pulsar/issues/10890#issuecomment-860007430


   @xuesongxs There's an explanation in the manual under ["Batching"](https://pulsar.apache.org/docs/en/next/concepts-messaging/#batching):
   
   > In Pulsar, batches are tracked and stored as single units rather than as individual messages. Consumer unbundles a batch into individual messages. However, scheduled messages (configured through the deliverAt or the deliverAfter parameter) are always sent as individual messages even batching is enabled.
   > 
   > In general, a batch is acknowledged when all of its messages are acknowledged by a consumer. It means unexpected failures, negative acknowledgements, or acknowledgement timeouts can result in redelivery of all messages in a batch, even if some of the messages are acknowledged.
   > 
   > To avoid redelivering acknowledged messages in a batch to the consumer, Pulsar introduces batch index acknowledgement since Pulsar 2.6.0. When batch index acknowledgement is enabled, the consumer filters out the batch index that has been acknowledged and sends the batch index acknowledgement request to the broker. The broker maintains the batch index acknowledgement status and tracks the acknowledgement status of each batch index to avoid dispatching acknowledged messages to the consumer. When all indexes of the batch message are acknowledged, the batch message is deleted.
   > 
   > By default, batch index acknowledgement is disabled (acknowledgmentAtBatchIndexLevelEnabled=false). You can enable batch index acknowledgement by setting the acknowledgmentAtBatchIndexLevelEnabled parameter to true at the broker side. Enabling batch index acknowledgement results in more memory overheads.
   > 
   
   Batching happens on the producer side. Another option for `acknowledgmentAtBatchIndexLevelEnabled=true` is to produce the messages into the topic without batching enabled. This can be achieved by setting `.enableBatching(false)` on the `ProducerBuilder`. 


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