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
FieldsModifier and TypeFieldDescriptionprotected final PulsarClientImplprotected URIprotected final StringFields inherited from class org.apache.pulsar.client.impl.ConsumerImpl
chunkedMessagesMap, expireTimeOfIncompleteChunkedMessageMillis, lastDequeuedMessageId, paused, statsFields 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, messageListenerExecutor, messageListenerQueueSize, pendingBatchReceives, pendingReceives, scaleReceiverQueueHint, schema, subscribeFuture, subscription, unAckedChunkedMessageIdSequenceMap, unAckedMessageTracker -
Constructor Summary
ConstructorsConstructorDescriptionZeroQueueConsumerImpl(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 booleancanEnqueueMessage(Message<T> message) protected booleanprotected booleanprotected booleanprotected booleancompareAndSetState(org.apache.pulsar.client.impl.HandlerState.State expect, org.apache.pulsar.client.impl.HandlerState.State update) protected voidconsumerIsReconnectedToBroker(ClientCnx cnx, int currentQueueSize) protected org.apache.pulsar.client.impl.HandlerState.StategetAndUpdateState(UnaryOperator<org.apache.pulsar.client.impl.HandlerState.State> updater) protected org.apache.pulsar.client.impl.HandlerState.StategetState()voidprotected CompletableFuture<Message<T>>intprotected voidprocessPayloadByProcessor(BrokerEntryMetadata brokerEntryMetadata, MessageMetadata messageMetadata, io.netty.buffer.ByteBuf byteBuf, MessageIdImpl messageId, Schema<T> schema, int redeliveryCount, List<Long> ackSet, long consumerEpoch) protected voidsetCurrentReceiverQueueSize(int newSize) Update the size of the consumer receive queue.protected voidsetRedirectedClusterURI(String serviceUrl, String serviceUrlTls) protected voidsetState(org.apache.pulsar.client.impl.HandlerState.State s) protected voidMethods inherited from class org.apache.pulsar.client.impl.ConsumerImpl
closeAsync, closeWhenReceivedUnrecoverableError, 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, isUnrecoverableError, messageProcessed, negativeAcknowledge, negativeAcknowledge, newMessage, newSingleMessage, numMessagesInQueue, pause, redeliverUnacknowledgedMessages, redeliverUnacknowledgedMessages, removeExpireIncompleteChunkedMessages, resume, seek, seek, seek, seekAsync, seekAsync, seekAsync, trackMessage, trackMessage, trackMessage, unsubscribeAsync, updateAutoScaleReceiverQueueHintMethods 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, increaseIncomingMessageSize, 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
-
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:
minReceiverQueueSizein classConsumerImpl<T>
-
initReceiverQueueSize
public void initReceiverQueueSize()- Overrides:
initReceiverQueueSizein classConsumerBase<T>
-
internalReceive
- Overrides:
internalReceivein classConsumerImpl<T>- Throws:
PulsarClientException
-
internalReceiveAsync
- Overrides:
internalReceiveAsyncin classConsumerImpl<T>
-
consumerIsReconnectedToBroker
- Overrides:
consumerIsReconnectedToBrokerin classConsumerImpl<T>
-
canEnqueueMessage
- Overrides:
canEnqueueMessagein classConsumerBase<T>
-
tryTriggerListener
protected void tryTriggerListener()- Overrides:
tryTriggerListenerin classConsumerBase<T>
-
setCurrentReceiverQueueSize
protected void setCurrentReceiverQueueSize(int newSize) Description copied from class:ConsumerBaseUpdate the size of the consumer receive queue. SeeConsumerBuilder.receiverQueueSize(int).- Overrides:
setCurrentReceiverQueueSizein classConsumerImpl<T>- Parameters:
newSize- new size of the receiver queue.
-
processPayloadByProcessor
protected void processPayloadByProcessor(BrokerEntryMetadata brokerEntryMetadata, MessageMetadata messageMetadata, io.netty.buffer.ByteBuf byteBuf, MessageIdImpl messageId, Schema<T> schema, int redeliveryCount, List<Long> ackSet, long consumerEpoch) - Overrides:
processPayloadByProcessorin classConsumerImpl<T>
-
setRedirectedClusterURI
protected void setRedirectedClusterURI(String serviceUrl, String serviceUrlTls) throws URISyntaxException - Throws:
URISyntaxException
-
changeToReadyState
protected boolean changeToReadyState() -
compareAndSetState
protected boolean compareAndSetState(org.apache.pulsar.client.impl.HandlerState.State expect, org.apache.pulsar.client.impl.HandlerState.State update) -
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
-