public class ConsumerImpl<T> extends Object implements Consumer<T>
| Modifier and Type | Field and Description |
|---|---|
protected Long |
ackTimeoutCount |
protected TimeUnit |
ackTimeoutUnit |
protected ConsumerParams |
conf |
protected Long |
consumerId |
protected String |
consumerName |
protected EndOfTopicMessageListener<T> |
endOfTopicMessageListener |
protected Boolean |
hasReachedEndOfTopic |
protected MessageId |
initialPosition |
protected Integer |
maxReceiverQueueSize |
protected ConcurrentLinkedQueue<CompletableFuture<Message<T>>> |
pendingReceives |
protected Integer |
priority |
protected Integer |
receiverQueueRefillThreshold |
protected String |
schema |
protected String |
subName |
protected Topic |
topic |
protected Long consumerId
protected Topic topic
protected String subName
protected String consumerName
protected String schema
protected Integer priority
protected MessageId initialPosition
protected EndOfTopicMessageListener<T> endOfTopicMessageListener
protected Long ackTimeoutCount
protected TimeUnit ackTimeoutUnit
protected ConsumerParams conf
protected Integer receiverQueueRefillThreshold
protected Integer maxReceiverQueueSize
protected Boolean hasReachedEndOfTopic
protected final ConcurrentLinkedQueue<CompletableFuture<Message<T>>> pendingReceives
protected void disconnect()
protected void reconnect()
protected void setTopicTerminated()
public Boolean hasReachedEndOfTopic()
hasReachedEndOfTopic in interface Consumer<T>public CompletableFuture<Boolean> hasMessageAvailable()
public CompletableFuture<Void> seek(MessageId messageId)
public boolean isConnected()
isConnected in interface Consumer<T>public CompletableFuture<Void> seek(long timestamp)
public Topic getTopic()
protected ConsumerParams getConf()
protected Long getConsumerId()
protected void clearReceiverQueue()
protected void enqueue(com.turtlequeue.sdk.api.proto.Tq.CommandMessage msg)
protected CompletableFuture<ConsumerImpl> subscribeReturn()
protected void increaseAvailablePermits(int delta)
protected void onMessageProcessed()
public CompletableFuture<Message<T>> receive()
public com.turtlequeue.sdk.api.proto.Tq.CommandMessage receive(long timeout,
TimeUnit unit)
throws Exception
Exceptionpublic AcknowledgeBuilder newAcknowledge()
public CompletableFuture<Void> acknowledge(MessageId messageId)
public CompletableFuture<Void> acknowledge(Message<T> message)
acknowledge in interface Consumer<T>public CompletableFuture<Void> nonAcknowledge(MessageId messageId)
nonAcknowledge in interface Consumer<T>public CompletableFuture<Void> nonAcknowledge(Message<T> message)
nonAcknowledge in interface Consumer<T>public CompletableFuture<Void> redeliverUnacknowledgedMessages()
redeliverUnacknowledgedMessages in interface Consumer<T>public CompletableFuture<Void> acknowledgeCumulativeAsync(Message<T> message)
acknowledgeCumulativeAsync in interface Consumer<T>protected CompletableFuture<Void> closeAsync(boolean informBroker)
public void close()
Copyright © 2019-2021, TurtleQueue All Rights Reserved. Use is subject to license terms.