Package org.apache.pulsar.client.impl
Class PatternConsumerUpdateQueue
java.lang.Object
org.apache.pulsar.client.impl.PatternConsumerUpdateQueue
Used to make all tasks that will modify subscriptions will be executed one by one, and skip the unnecessary updating.
So far, four three scenarios that will modify subscriptions:
1. When start pattern consumer.
2. After topic list watcher reconnected, it will call
} or
}.
When you are using this client connect to the broker whose version >= 2.11, there are three scenarios: [1, 2, 4].
When you are using this client connect to the broker whose version invalid input: '<' 2.11, there is only one scenario: [3] and all
the event will run in the same thread.
PatternMultiTopicsConsumerImpl.recheckTopicsChange().
this scenario only exists in the version >= 2.11 (both client-version and broker version are >= 2.11).
3. A scheduled task will call PatternMultiTopicsConsumerImpl.recheckTopicsChange(), this scenario only
exists in the version invalid input: '<' 2.11.
4. The topics change events will trigger a
invalid @link
{@link PatternMultiTopicsConsumerImpl#topicsChangeListener#onTopicsRemoved(Collection)
invalid @link
{@link PatternMultiTopicsConsumerImpl#topicsChangeListener#onTopicsAdded(Collection)
-
Constructor Summary
ConstructorsConstructorDescriptionPatternConsumerUpdateQueue(PatternMultiTopicsConsumerImpl patternConsumer) PatternConsumerUpdateQueue(PatternMultiTopicsConsumerImpl patternConsumer, org.apache.pulsar.client.impl.PatternMultiTopicsConsumerImpl.TopicsChangedListener topicsChangeListener) This constructor is only for test. -
Method Summary
-
Constructor Details
-
PatternConsumerUpdateQueue
-
PatternConsumerUpdateQueue
public PatternConsumerUpdateQueue(PatternMultiTopicsConsumerImpl patternConsumer, org.apache.pulsar.client.impl.PatternMultiTopicsConsumerImpl.TopicsChangedListener topicsChangeListener) This constructor is only for test.
-
-
Method Details
-
cancelAllAndWaitForTheRunningTask
-