DL1231 commented on code in PR #20148:
URL: https://github.com/apache/kafka/pull/20148#discussion_r2200440939
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/ClusterInstance.java:
##########
@@ -178,12 +179,16 @@ default <K, V> ShareConsumer<K, V> shareConsumer() {
}
default <K, V> ShareConsumer<K, V> shareConsumer(Map<String, Object>
configs) {
+ return new KafkaShareConsumer<>(configs, null, null);
+ }
+
+ default <K, V> ShareConsumer<K, V> shareConsumer(Map<String, Object>
configs, Deserializer<K> keyDeserializer, Deserializer<V> valueDeserializer) {
Map<String, Object> props = new HashMap<>(configs);
props.putIfAbsent(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG,
ByteArrayDeserializer.class.getName());
Review Comment:
https://github.com/apache/kafka/blob/2346c0e7370d0859b0c4fe68a75b743af788c2b5/clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java#L743-L744
Thanks for your review. During initialization, if the keyDeserializer is
set, it will override the class name in the config.
Of course, the explicit check here makes the logic clearer. I'll fix it
later.
--
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]