Question around custom Partition assignments
bcarter97 opened this issue · 3 comments
bcarter97 commented
Hello, I am trying to create an assignment manually and I've noticed a difference between the FS2 KafkaConsumer and underlying KafkaConsumer with the overload for
I'm not sure why it requires a NonEmptySet
of partitions, as the underlying consumer does an empty check and calls unsubscribe
if the partition set is empty:
if (partitions == null) {
throw new IllegalArgumentException("Topic partition collection to assign to cannot be null");
} else if (partitions.isEmpty()) {
this.unsubscribe();
}
...
Do you think it is required that the Set should be NonEmpty? If the TopicPartitions are incorrect a java.lang.IllegalStateException: No current assignment
will be thrown by the KafkaConsumer so validating the TopicPartitions Set seems redundant