-
Notifications
You must be signed in to change notification settings - Fork 14k
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
KAFKA-17338 ConsumerConfig should prevent using partition assignors with CONSUMER group protocol #16899
base: trunk
Are you sure you want to change the base?
KAFKA-17338 ConsumerConfig should prevent using partition assignors with CONSUMER group protocol #16899
Changes from all commits
5f17f52
38fa6c9
59da76d
2ee47e6
e8354a6
ec363a1
9117089
be90c63
6c975f5
8bcbdee
8846272
0e77b0d
9edd23f
f705555
55108c5
c805310
a03d614
07a7a7e
b81c90a
baa285e
c306364
0841459
76e5c85
15d3255
8fc8205
fbf606b
c0bb015
abfb729
1d3dbc0
e038978
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -337,8 +337,9 @@ private Map<String, Object> composeConfigs(ClusterInstance cluster, String group | |
configs.put(KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); | ||
configs.put(VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); | ||
configs.put(GROUP_PROTOCOL_CONFIG, groupProtocol); | ||
configs.put(PARTITION_ASSIGNMENT_STRATEGY_CONFIG, RangeAssignor.class.getName()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just to double check, even though we're removing this prop, I expect the test will still use the range assignor if under classic protocol just because range is the first assignor in the default value of the config. Correct? |
||
|
||
if (GroupProtocol.CLASSIC.name.equalsIgnoreCase(groupProtocol)) { | ||
configs.put(PARTITION_ASSIGNMENT_STRATEGY_CONFIG, RangeAssignor.class.getName()); | ||
} | ||
configs.putAll(customConfigs); | ||
return configs; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -511,7 +511,9 @@ private Map<String, Object> composeConfigs(String groupId, String groupProtocol, | |
configs.put(KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); | ||
configs.put(VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); | ||
configs.put(GROUP_PROTOCOL_CONFIG, groupProtocol); | ||
configs.put(PARTITION_ASSIGNMENT_STRATEGY_CONFIG, RangeAssignor.class.getName()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we explicitly set it as you did on |
||
if (GroupProtocol.CLASSIC.name.equalsIgnoreCase(groupProtocol)) { | ||
configs.put(PARTITION_ASSIGNMENT_STRATEGY_CONFIG, RangeAssignor.class.getName()); | ||
} | ||
|
||
configs.putAll(customConfigs); | ||
return configs; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -800,9 +800,11 @@ private Map<String, Object> composeConsumerConfigs(ClusterInstance cluster, | |
configs.put(GROUP_PROTOCOL_CONFIG, groupProtocol.name); | ||
configs.put(KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); | ||
configs.put(VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); | ||
configs.put(PARTITION_ASSIGNMENT_STRATEGY_CONFIG, RangeAssignor.class.getName()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we explicitly set it as you did on |
||
configs.put(AUTO_COMMIT_INTERVAL_MS_CONFIG, 1000); | ||
configs.put(GROUP_INITIAL_REBALANCE_DELAY_MS_CONFIG, 1000); | ||
if (GroupProtocol.CLASSIC == groupProtocol) { | ||
configs.put(PARTITION_ASSIGNMENT_STRATEGY_CONFIG, RangeAssignor.class.getName()); | ||
} | ||
return configs; | ||
} | ||
|
||
|
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.
could we simplify here and call
checkUnsupportedConfigs
once, with the groupProtocol read from the config? (seems clearer to have a single call that would encapsulate the logic to determine theunsupportedConfigs
list to use based on the protocol used in the config, which is only one, seems a bit confusing how we check here for the 2 protocols). Makes sense?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.
I prefer the current approach because it allows us to reuse this method in the future if new protocols are added, without having to add additional if-else statements to the original method. WDYT?