-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Pattern subscription doesn't work when the pattern excludes the topic domain. #24072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…udes the topic domain.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #24072 +/- ##
============================================
+ Coverage 73.57% 74.23% +0.66%
+ Complexity 32624 32428 -196
============================================
Files 1877 1863 -14
Lines 139502 144291 +4789
Branches 15299 16459 +1160
============================================
+ Hits 102638 107115 +4477
+ Misses 28908 28719 -189
- Partials 7956 8457 +501
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
lhotari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also update the javadoc which is now outdated:
pulsar/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ConsumerBuilder.java
Lines 145 to 146 in f199e88
| * <p>It accepts a regular expression that is compiled into a pattern internally. E.g., | |
| * "persistent://public/default/pattern-topic-.*" |
I guess it could be explained that the
persistent:// / non-persistent:// prefix is ignored when evaluating the pattern.
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/TopicListService.java
Show resolved
Hide resolved
lhotari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Good work @shibd |
…udes the topic domain. (apache#24072) (cherry picked from commit 3bae1d1) (cherry picked from commit bc02193)
…udes the topic domain. (apache#24072) (cherry picked from commit 3bae1d1) (cherry picked from commit bc02193)
…udes the topic domain. (apache#24072) (cherry picked from commit 3bae1d1)
…udes the topic domain. (apache#24072) (cherry picked from commit 3bae1d1) (cherry picked from commit 6797678)
…udes the topic domain. (apache#24072) (cherry picked from commit 3bae1d1) (cherry picked from commit 6797678)
…udes the topic domain. (apache#24072)
Motivation
After #16062, we use a notification machine to discover topic changes for pattern subscriptions.
If the user sets a pattern string like
my-property/my-ns/test-pattern.*(without topic domain) when creating a subscription.It doesn't receive updates for the latest topics because the topic names include the domain when matching.
For example:
persistent://my-property/my-ns/test-pattern-1my-property/my-ns/test-pattern.*pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/TopicListService.java
Line 73 in fad925f
You can run test to reproduce it:
testSubscribePatterWithOutTopicDomainBTW: This issue has always existed, but some clients had a fallback by periodically querying topics for updates.
For the Java client, this has been removed after #20779, which is why the issue occurs.
Modifications
topic nameand thetopic patternfor matching.Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: