Class PatternConsumerUpdateQueue

java.lang.Object
org.apache.pulsar.client.impl.PatternConsumerUpdateQueue

public class PatternConsumerUpdateQueue extends Object
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 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 < 2.11. 4. The topics change events will trigger a {@link PatternMultiTopicsConsumerImpl#topicsChangeListener#onTopicsRemoved(Collection)} or {@link PatternMultiTopicsConsumerImpl#topicsChangeListener#onTopicsAdded(Collection)}. 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 < 2.11, there is only one scenario: [3] and all the event will run in the same thread.
  • Constructor Details

    • PatternConsumerUpdateQueue

      public PatternConsumerUpdateQueue(PatternMultiTopicsConsumerImpl patternConsumer)
    • PatternConsumerUpdateQueue

      public PatternConsumerUpdateQueue(PatternMultiTopicsConsumerImpl patternConsumer, org.apache.pulsar.client.impl.PatternMultiTopicsConsumerImpl.TopicsChangedListener topicsChangeListener)
      This constructor is only for test.
  • Method Details