Skip to content

Add getEndOffsets() to KafkaTestUtils #1666

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

Merged
merged 2 commits into from
Jan 4, 2021

Conversation

garyrussell
Copy link
Contributor

cherry-pick to 2.6.x

**cherry-pick to 2.6.x**
Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chances to document this new API of testing utils?
Or we just point to its JavaDocs from the reference?

Thanks

.collect(Collectors.toList());
}
else {
Assert.noNullElements(partitions, "'partitions' cannot have nulll elements");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo:

Suggested change
Assert.noNullElements(partitions, "'partitions' cannot have nulll elements");
Assert.noNullElements(partitions, "'partitions' cannot have null elements");

* @param topic the topic.
* @param partitions the partitions, or null for all partitions.
* @return the map of end offsets.
* @since 2.6.5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need to add a @see for JavaDocs of that consumer.endOffsets() because that is exactly an info we get back.

* @return the map of end offsets.
* @since 2.6.5
*/
public static <K, V> Map<TopicPartition, Long> getEndOffsets(Consumer<K, V> consumer, String topic,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these generic arguments don't give any value or benefits.
Probably Consumer<?, ?> is what would work for end-users. Even if we need to do some casting internally, it is not going to affect target applications.

@artembilan artembilan merged commit b9599a8 into spring-projects:master Jan 4, 2021
@artembilan
Copy link
Member

... and cherry-picked to 2.6.x.

@garyrussell garyrussell deleted the endOffsets branch January 4, 2021 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants