Package org.apache.pulsar.client.impl
Class ZeroQueueConsumerImpl<T>
java.lang.Object
org.apache.pulsar.client.impl.ConsumerBase<T>
org.apache.pulsar.client.impl.ConsumerImpl<T>
org.apache.pulsar.client.impl.ZeroQueueConsumerImpl<T>
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Consumer<T>
,MessageAcknowledger
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.pulsar.client.impl.ConsumerBase
ConsumerBase.OpBatchReceive<T>
-
Field Summary
Modifier and TypeFieldDescriptionprotected final PulsarClientImpl
protected URI
protected final String
Fields inherited from class org.apache.pulsar.client.impl.ConsumerImpl
chunkedMessagesMap, expireTimeOfIncompleteChunkedMessageMillis, lastDequeuedMessageId, paused, stats
Fields inherited from class org.apache.pulsar.client.impl.ConsumerBase
batchReceivePolicy, batchReceiveTimeout, conf, CONSUMER_EPOCH, consumerEpoch, consumerEventListener, consumerName, CURRENT_RECEIVER_QUEUE_SIZE_UPDATER, executorProvider, externalPinnedExecutor, incomingMessagesSize, incomingQueueLock, INITIAL_RECEIVER_QUEUE_SIZE, interceptors, internalPinnedExecutor, listener, maxReceiverQueueSize, MEMORY_THRESHOLD_FOR_RECEIVER_QUEUE_SIZE_EXPANSION, MESSAGE_LISTENER_QUEUE_SIZE_UPDATER, messageListenerQueueSize, pendingBatchReceives, pendingReceives, scaleReceiverQueueHint, schema, subscribeFuture, subscription, unAckedChunkedMessageIdSequenceMap, unAckedMessageTracker
-
Constructor Summary
ConstructorDescriptionZeroQueueConsumerImpl
(PulsarClientImpl client, String topic, ConsumerConfigurationData<T> conf, ExecutorProvider executorProvider, int partitionIndex, boolean hasParentConsumer, CompletableFuture<Consumer<T>> subscribeFuture, MessageId startMessageId, Schema<T> schema, ConsumerInterceptors<T> interceptors, boolean createTopicIfDoesNotExist) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canEnqueueMessage
(Message<T> message) protected boolean
protected boolean
protected boolean
protected void
consumerIsReconnectedToBroker
(ClientCnx cnx, int currentQueueSize) protected org.apache.pulsar.client.impl.HandlerState.State
getAndUpdateState
(UnaryOperator<org.apache.pulsar.client.impl.HandlerState.State> updater) protected org.apache.pulsar.client.impl.HandlerState.State
getState()
void
protected CompletableFuture<Message<T>>
int
protected void
setCurrentReceiverQueueSize
(int newSize) Update the size of the consumer receive queue.protected void
setRedirectedClusterURI
(String serviceUrl, String serviceUrlTls) protected void
setState
(org.apache.pulsar.client.impl.HandlerState.State s) protected void
Methods inherited from class org.apache.pulsar.client.impl.ConsumerImpl
closeAsync, completeOpBatchReceive, connectionFailed, connectionOpened, doAcknowledge, doAcknowledge, doReconsumeLater, equals, getAvailablePermits, getClientCnx, getConnectionHandler, getLastDisconnectedTimestamp, getLastMessageIdAsync, getLastMessageIdsAsync, getPossibleSendToDeadLetterTopicMessages, getStats, getTopicNameWithoutPartition, getUnAckedMessageTracker, hashCode, hasMessageAvailable, hasMessageAvailableAsync, hasReachedEndOfTopic, increaseAvailablePermits, increaseAvailablePermits, internalBatchReceive, internalBatchReceiveAsync, internalGetLastMessageIdAsync, internalReceive, isBatch, isConnected, isConnected, messageProcessed, negativeAcknowledge, negativeAcknowledge, newMessage, newSingleMessage, numMessagesInQueue, pause, redeliverUnacknowledgedMessages, redeliverUnacknowledgedMessages, removeExpireIncompleteChunkedMessages, resume, seek, seek, seek, seekAsync, seekAsync, seekAsync, trackMessage, trackMessage, trackMessage, unsubscribeAsync, updateAutoScaleReceiverQueueHint
Methods inherited from class org.apache.pulsar.client.impl.ConsumerBase
acknowledge, acknowledge, acknowledge, acknowledge, acknowledgeAsync, acknowledgeAsync, acknowledgeAsync, acknowledgeAsync, acknowledgeAsync, acknowledgeAsync, acknowledgeAsync, acknowledgeCumulative, acknowledgeCumulative, acknowledgeCumulativeAsync, acknowledgeCumulativeAsync, acknowledgeCumulativeAsync, batchReceive, batchReceiveAsync, beforeConsume, callMessageListener, clearIncomingMessages, close, completePendingBatchReceive, completePendingReceive, decreaseIncomingMessageSize, doAcknowledgeWithTxn, doAcknowledgeWithTxn, enqueueMessageAndCheckBatchReceive, expectMoreIncomingMessages, failPendingReceive, getConsumerName, getCurrentReceiverQueueSize, getIncomingMessageSize, getLastMessageId, getLastMessageIds, getNewMessagesImpl, getSubscription, getSubType, getTopic, getTotalIncomingMessages, hasBatchReceiveTimeout, hasEnoughMessagesForBatchReceive, hasNextPendingReceive, hasPendingBatchReceive, isSingleMessageAcked, isValidConsumerEpoch, negativeAcknowledge, nextPendingReceive, notifyPendingBatchReceivedCallBack, notifyPendingBatchReceivedCallBack, onAcknowledge, onAcknowledge, onAcknowledgeCumulative, onAcknowledgeCumulative, onAckTimeoutSend, onNegativeAcksSend, onPartitionsChange, peekMessageKey, receive, receive, receiveAsync, reconsumeLater, reconsumeLater, reconsumeLater, reconsumeLaterAsync, reconsumeLaterAsync, reconsumeLaterAsync, reconsumeLaterCumulative, reconsumeLaterCumulativeAsync, reconsumeLaterCumulativeAsync, reduceCurrentReceiverQueueSize, resetIncomingMessageSize, subscribeFuture, toString, trackUnAckedMsgIfNoListener, triggerBatchReceiveTimeoutTask, unsubscribe, unsubscribe, unsubscribeAsync
-
Field Details
-
client
-
topic
-
redirectedClusterURI
-
-
Constructor Details
-
ZeroQueueConsumerImpl
public ZeroQueueConsumerImpl(PulsarClientImpl client, String topic, ConsumerConfigurationData<T> conf, ExecutorProvider executorProvider, int partitionIndex, boolean hasParentConsumer, CompletableFuture<Consumer<T>> subscribeFuture, MessageId startMessageId, Schema<T> schema, ConsumerInterceptors<T> interceptors, boolean createTopicIfDoesNotExist)
-
-
Method Details
-
minReceiverQueueSize
public int minReceiverQueueSize()- Overrides:
minReceiverQueueSize
in classConsumerImpl<T>
-
initReceiverQueueSize
public void initReceiverQueueSize()- Overrides:
initReceiverQueueSize
in classConsumerBase<T>
-
internalReceive
- Overrides:
internalReceive
in classConsumerImpl<T>
- Throws:
PulsarClientException
-
internalReceiveAsync
- Overrides:
internalReceiveAsync
in classConsumerImpl<T>
-
consumerIsReconnectedToBroker
- Overrides:
consumerIsReconnectedToBroker
in classConsumerImpl<T>
-
canEnqueueMessage
- Overrides:
canEnqueueMessage
in classConsumerBase<T>
-
tryTriggerListener
protected void tryTriggerListener()- Overrides:
tryTriggerListener
in classConsumerBase<T>
-
setCurrentReceiverQueueSize
protected void setCurrentReceiverQueueSize(int newSize) Description copied from class:ConsumerBase
Update the size of the consumer receive queue. SeeConsumerBuilder.receiverQueueSize(int)
.- Overrides:
setCurrentReceiverQueueSize
in classConsumerImpl<T>
- Parameters:
newSize
- new size of the receiver queue.
-
setRedirectedClusterURI
protected void setRedirectedClusterURI(String serviceUrl, String serviceUrlTls) throws URISyntaxException - Throws:
URISyntaxException
-
changeToReadyState
protected boolean changeToReadyState() -
changeToRegisteringSchemaState
protected boolean changeToRegisteringSchemaState() -
getState
protected org.apache.pulsar.client.impl.HandlerState.State getState() -
changeToConnecting
protected boolean changeToConnecting() -
setState
protected void setState(org.apache.pulsar.client.impl.HandlerState.State s) -
getAndUpdateState
protected org.apache.pulsar.client.impl.HandlerState.State getAndUpdateState(UnaryOperator<org.apache.pulsar.client.impl.HandlerState.State> updater) -
getClient
-