Denovo1998 opened a new pull request, #23794:
URL: https://github.com/apache/pulsar/pull/23794

   <!-- or this PR is one task of an issue -->
   
   Main Issue: #xyz
   
   <!-- Details of when a PIP is required and how the PIP process work, please 
see: https://github.com/apache/pulsar/blob/master/pip/README.md -->
   
   ### Motivation
   
   <!-- Explain here the context, and why you're making that change. What is 
the problem you're trying to solve. -->
   When using regex to subscribe to topics, we may find that some subscribed 
topics are slow to process, which may lead to blocking other topics from being 
blocked.
   
   Possible related discussions are in 
https://www.reddit.com/r/ApachePulsar/comments/1fssbbn/roundrobin_between_wildcard_topics/
   
   When using `MultiTopicsConsumerImpl`, we can call this.
   
   
https://github.com/apache/pulsar/blob/5a3a1f169a7f90181bd5c213c8e9f479bc74f0f2/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java#L1246-L1258
   
   There is a test case that explains how to unsubscribe from a single topic.
   
   
https://github.com/apache/pulsar/blob/5a3a1f169a7f90181bd5c213c8e9f479bc74f0f2/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/TopicsConsumerImplTest.java#L660-L663
   
   We need to implement similar functionality in 
PatternMultiTopicsConsumerImpl. 
   
   **This can also dynamically modify the topicsPattern set when the consumer 
is created.**
   
   ### Modifications
   
   <!-- Describe the modifications you've done. -->
   
   In PatternMultiTopicsConsumerImpl, add two methods, unBlockTopics and 
blockTopics.
   
   When calling blockTopics, directly unsubscribe by calling onTopicsRemoved of 
TopicsChangedListener.
   
   When calling unBlockTopics, add a consumer by calling onTopicsAdded.
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe 
tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads 
(10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update 
later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: <!-- ENTER URL HERE -->
   
   <!--
   After opening this PR, the build in apache/pulsar will fail and instructions 
will
   be provided for opening a PR in the PR author's forked repository.
   
   apache/pulsar pull requests should be first tested in your own fork since 
the 
   apache/pulsar CI based on GitHub Actions has constrained resources and quota.
   GitHub Actions provides separate quota for pull requests that are executed 
in 
   a forked repository.
   
   The tests will be run in the forked repository until all PR review comments 
have
   been handled, the tests pass and the PR is approved by a reviewer.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to