lianetm commented on code in PR #17463:
URL: https://github.com/apache/kafka/pull/17463#discussion_r1819735258
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -1314,8 +1331,12 @@ private void
throwIfConsumerGroupHeartbeatRequestIsInvalid(
if (request.topicPartitions() == null ||
!request.topicPartitions().isEmpty()) {
throw new InvalidRequestException("TopicPartitions must be
empty when (re-)joining.");
}
- if (request.subscribedTopicNames() == null ||
request.subscribedTopicNames().isEmpty()) {
- throw new InvalidRequestException("SubscribedTopicNames must
be set in first request.");
+ boolean hasSubscribedTopics =
+ request.subscribedTopicNames() != null &&
!request.subscribedTopicNames().isEmpty();
Review Comment:
they both look very similar indeed, but `subscribedTopicNames` is
list<string> and `subscribedTopicRegex` is a string so a reusable helper for
the empty check would be a bit tricky, probably making it more complicated I'm
afraid? not sure if I missing something
--
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]