-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Update contract changes for KIP-848 regex subscription #5251
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
base: master
Are you sure you want to change the base?
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
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.
Pull request overview
This PR documents contract changes related to KIP-848's regex subscription handling, specifically the shift from client-side to broker-side regex matching with a different regex engine.
- Adds documentation for regex subscription behavior changes in the KIP-848 consumer protocol
- Documents the migration from libc regex engine (client-side) to Google RE2/J engine (broker-side)
- Provides a concrete example of regex pattern incompatibility between protocols
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| As part of adopting the `consumer` protocol, librdkafka (and derived clients) now rely on the broker’s RE2/J engine for regex-based subscriptions, effectively replacing the previous `libc`-based matching behavior. | ||
|
|
||
| Known case which would fail with the new protocol - We have `topic-1` and `topic-2`. If we subscribe with `^topic*` in the `classic` protocol, it works but it won't work in the `consumer` protocol. Use `^topic.*` instead. |
Copilot
AI
Nov 27, 2025
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.
[nitpick] The sentence structure is unclear and could be improved for better readability. Consider rephrasing to: 'A known incompatibility case: Given topics topic-1 and topic-2, the pattern ^topic* works in the classic protocol but fails in the consumer protocol. Use ^topic.* instead.'
| Known case which would fail with the new protocol - We have `topic-1` and `topic-2`. If we subscribe with `^topic*` in the `classic` protocol, it works but it won't work in the `consumer` protocol. Use `^topic.*` instead. | |
| A known incompatibility case: Given topics `topic-1` and `topic-2`, the pattern `^topic*` works in the `classic` protocol but fails in the `consumer` protocol. Use `^topic.*` instead. |
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.
Thanks for the clarification I proposed some changes.
There's also a change to the example regex ^topic given using ^topic* is also matching topi and we don't want to add this element that creates confusion about the proposed example change.
|
|
||
| As part of adopting the `consumer` protocol, librdkafka (and derived clients) now rely on the broker’s RE2/J engine for regex-based subscriptions, effectively replacing the previous `libc`-based matching behavior. | ||
|
|
||
| Known case which would fail with the new protocol - We have `topic-1` and `topic-2`. If we subscribe with `^topic*` in the `classic` protocol, it works but it won't work in the `consumer` protocol. Use `^topic.*` instead. |
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.
| Known case which would fail with the new protocol - We have `topic-1` and `topic-2`. If we subscribe with `^topic*` in the `classic` protocol, it works but it won't work in the `consumer` protocol. Use `^topic.*` instead. | |
| A known case which would fail with the new protocol: we have topics `topic-1` and `topic-2`. If we subscribe with `^topic` in the `classic` protocol, it's assigned partitions from both topics but no partitions is assigned with the `consumer` protocol. That's because the broker side regex implementation as well as the Java classic protocol one require that regexes match the complete topic while `libc` one finds the pattern into the topic, that could be present as a prefix. To obtain the same result with this example you'd use `^topic.*` instead. |
No description provided.