Package org.apache.pulsar.client.impl
Class PatternMultiTopicsConsumerImpl<T>
java.lang.Object
org.apache.pulsar.client.impl.ConsumerBase<T>
org.apache.pulsar.client.impl.MultiTopicsConsumerImpl<T>
org.apache.pulsar.client.impl.PatternMultiTopicsConsumerImpl<T>
- All Implemented Interfaces:
io.netty.util.TimerTask,Closeable,AutoCloseable,Consumer<T>,MessageAcknowledger
public class PatternMultiTopicsConsumerImpl<T>
extends MultiTopicsConsumerImpl<T>
implements io.netty.util.TimerTask
-
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 NamespaceNameprotected URIprotected final StringFields inherited from class org.apache.pulsar.client.impl.MultiTopicsConsumerImpl
consumers, DUMMY_TOPIC_NAME_PREFIX, partitionedTopics, pausedConsumersFields 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
ConstructorsConstructorDescriptionPatternMultiTopicsConsumerImpl(Pattern topicsPattern, String topicsHash, PulsarClientImpl client, ConsumerConfigurationData<T> conf, ExecutorProvider executorProvider, CompletableFuture<Consumer<T>> subscribeFuture, Schema<T> schema, CommandGetTopicsOfNamespace.Mode subscriptionMode, ConsumerInterceptors<T> interceptors) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected booleanprotected booleanprotected booleancompareAndSetState(org.apache.pulsar.client.impl.HandlerState.State expect, org.apache.pulsar.client.impl.HandlerState.State update) protected org.apache.pulsar.client.impl.HandlerState.StategetAndUpdateState(UnaryOperator<org.apache.pulsar.client.impl.HandlerState.State> updater) static NamespaceNamegetNameSpaceFromPattern(Pattern pattern) protected org.apache.pulsar.client.impl.HandlerState.StategetState()protected voidhandleSubscribeOneTopicError(String topicName, Throwable error, CompletableFuture<Void> subscribeFuture) voidrun(io.netty.util.Timeout timeout) protected voidsetRedirectedClusterURI(String serviceUrl, String serviceUrlTls) protected voidsetState(org.apache.pulsar.client.impl.HandlerState.State s) Methods inherited from class org.apache.pulsar.client.impl.MultiTopicsConsumerImpl
completeOpBatchReceive, createPartitionedConsumer, doAcknowledge, doAcknowledge, doReconsumeLater, getAvailablePermits, getConsumers, getLastDisconnectedTimestamp, getLastMessageIdAsync, getLastMessageIdsAsync, getPartitionedTopics, getPartitions, getPartitionsAutoUpdateTimeout, getStats, getUnAckedMessageTracker, hasMessageAvailable, hasMessageAvailableAsync, hasReachedEndOfTopic, internalBatchReceive, internalBatchReceiveAsync, internalReceive, internalReceive, internalReceiveAsync, isConnected, isIllegalMultiTopicsMessageId, messageProcessed, minReceiverQueueSize, negativeAcknowledge, negativeAcknowledge, numMessagesInQueue, pause, redeliverUnacknowledgedMessages, redeliverUnacknowledgedMessages, resume, seek, seek, seek, seekAsync, seekAsync, seekAsync, setCurrentReceiverQueueSize, subscribeAsync, tryAcknowledgeMessage, unsubscribeAsync, 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, canEnqueueMessage, 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, initReceiverQueueSize, 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, tryTriggerListener, unsubscribe
-
Field Details
-
namespaceName
-
client
-
topic
-
redirectedClusterURI
-
-
Constructor Details
-
PatternMultiTopicsConsumerImpl
public PatternMultiTopicsConsumerImpl(Pattern topicsPattern, String topicsHash, PulsarClientImpl client, ConsumerConfigurationData<T> conf, ExecutorProvider executorProvider, CompletableFuture<Consumer<T>> subscribeFuture, Schema<T> schema, CommandGetTopicsOfNamespace.Mode subscriptionMode, ConsumerInterceptors<T> interceptors) - Parameters:
topicsPattern- The regexp for the topic name(not contains partition suffix).
-
-
Method Details
-
getNameSpaceFromPattern
-
run
- Specified by:
runin interfaceio.netty.util.TimerTask- Throws:
Exception
-
getPattern
-
closeAsync
- Specified by:
closeAsyncin interfaceConsumer<T>- Overrides:
closeAsyncin classMultiTopicsConsumerImpl<T>
-
handleSubscribeOneTopicError
protected void handleSubscribeOneTopicError(String topicName, Throwable error, CompletableFuture<Void> subscribeFuture) - Overrides:
handleSubscribeOneTopicErrorin classMultiTopicsConsumerImpl<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
-