public class PersistentAcknowledgmentsGroupingTracker extends Object implements AcknowledgmentsGroupingTracker
| Constructor and Description |
|---|
PersistentAcknowledgmentsGroupingTracker(ConsumerImpl<?> consumer,
ConsumerConfigurationData<?> conf,
io.netty.channel.EventLoopGroup eventLoopGroup) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
addAcknowledgment(MessageIdImpl msgId,
CommandAck.AckType ackType,
Map<String,Long> properties) |
CompletableFuture<Void> |
addListAcknowledgment(List<MessageId> messageIds,
CommandAck.AckType ackType,
Map<String,Long> properties) |
void |
close() |
void |
flush()
Flush all the pending acks and send them to the broker
|
void |
flushAndClean() |
boolean |
isDuplicate(@NonNull 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.
|
public PersistentAcknowledgmentsGroupingTracker(ConsumerImpl<?> consumer, ConsumerConfigurationData<?> conf, io.netty.channel.EventLoopGroup eventLoopGroup)
public boolean isDuplicate(@NonNull
@NonNull MessageId messageId)
isDuplicate in interface AcknowledgmentsGroupingTrackerpublic CompletableFuture<Void> addListAcknowledgment(List<MessageId> messageIds, CommandAck.AckType ackType, Map<String,Long> properties)
addListAcknowledgment in interface AcknowledgmentsGroupingTrackerpublic CompletableFuture<Void> addAcknowledgment(MessageIdImpl msgId, CommandAck.AckType ackType, Map<String,Long> properties)
addAcknowledgment in interface AcknowledgmentsGroupingTrackerpublic void flush()
flush in interface AcknowledgmentsGroupingTrackerpublic void flushAndClean()
flushAndClean in interface AcknowledgmentsGroupingTrackerpublic void close()
close in interface AutoCloseableclose in interface AcknowledgmentsGroupingTrackerCopyright © 2017–2021 Apache Software Foundation. All rights reserved.