Package org.apache.pulsar.client.impl
Class PersistentAcknowledgmentsGroupingTracker
java.lang.Object
org.apache.pulsar.client.impl.PersistentAcknowledgmentsGroupingTracker
- All Implemented Interfaces:
AutoCloseable,AcknowledgmentsGroupingTracker
public class PersistentAcknowledgmentsGroupingTracker
extends Object
implements AcknowledgmentsGroupingTracker
Group the acknowledgements for a certain time and then sends them out in a single protobuf command.
-
Constructor Summary
ConstructorsConstructorDescriptionPersistentAcknowledgmentsGroupingTracker(ConsumerImpl<?> consumer, ConsumerConfigurationData<?> conf, io.netty.channel.EventLoopGroup eventLoopGroup) -
Method Summary
Modifier and TypeMethodDescriptionaddAcknowledgment(MessageIdImpl msgId, org.apache.pulsar.common.api.proto.CommandAck.AckType ackType, Map<String, Long> properties) addListAcknowledgment(List<org.apache.pulsar.client.api.MessageId> messageIds, org.apache.pulsar.common.api.proto.CommandAck.AckType ackType, Map<String, Long> properties) voidclose()voidflush()Flush all the pending acks and send them to the broker.voidbooleanisDuplicate(org.apache.pulsar.client.api.MessageId messageId) Since the ack are delayed, we need to do some best-effort duplicate check to discard messages that are being resent after a disconnection and for which the user has already sent an acknowledgement.
-
Constructor Details
-
PersistentAcknowledgmentsGroupingTracker
public PersistentAcknowledgmentsGroupingTracker(ConsumerImpl<?> consumer, ConsumerConfigurationData<?> conf, io.netty.channel.EventLoopGroup eventLoopGroup)
-
-
Method Details
-
isDuplicate
public boolean isDuplicate(org.apache.pulsar.client.api.MessageId messageId) Since the ack are delayed, we need to do some best-effort duplicate check to discard messages that are being resent after a disconnection and for which the user has already sent an acknowledgement.- Specified by:
isDuplicatein interfaceAcknowledgmentsGroupingTracker
-
addListAcknowledgment
public CompletableFuture<Void> addListAcknowledgment(List<org.apache.pulsar.client.api.MessageId> messageIds, org.apache.pulsar.common.api.proto.CommandAck.AckType ackType, Map<String, Long> properties) - Specified by:
addListAcknowledgmentin interfaceAcknowledgmentsGroupingTracker
-
addAcknowledgment
public CompletableFuture<Void> addAcknowledgment(MessageIdImpl msgId, org.apache.pulsar.common.api.proto.CommandAck.AckType ackType, Map<String, Long> properties) - Specified by:
addAcknowledgmentin interfaceAcknowledgmentsGroupingTracker
-
flush
public void flush()Flush all the pending acks and send them to the broker.- Specified by:
flushin interfaceAcknowledgmentsGroupingTracker
-
flushAndClean
public void flushAndClean()- Specified by:
flushAndCleanin interfaceAcknowledgmentsGroupingTracker
-
close
public void close()- Specified by:
closein interfaceAcknowledgmentsGroupingTracker- Specified by:
closein interfaceAutoCloseable
-