Skip to content
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

Expose Consumer Assignment through ConsumerRegistry #339

Merged

Conversation

brianwyka
Copy link
Contributor

@brianwyka brianwyka commented Mar 8, 2021

Expose each consumer's subscriptions and assignment through the ConsumerRegistry keyed by client id. This information is hard to get since it can only be accessed from poll loop thread.

@graemerocher
Copy link
Contributor

could you add a test?

@brianwyka
Copy link
Contributor Author

Sure, I will do that.

@brianwyka
Copy link
Contributor Author

@graemerocher, added a test as well as exposed the subscriptions (topics).

It seems that the subscriptions are available before the poll loop begins, and then the assignment becomes available within the poll loop after partitions have been assigned. Although, I'm not exactly sure, precisely, when the assignment is happening.

@brianwyka
Copy link
Contributor Author

brianwyka commented Mar 8, 2021

I'm looking to use this functionality within a custom health indicator which determines kafka health based on the existence of consumers of specific topics.

Based on configuration, you will be able to determine healthy if a specific topic is being consumed from.

Do you think that would be valuable to add here, or too specific of a use case?

@brianwyka
Copy link
Contributor Author

This should be ready to go @graemerocher. I can follow up with another feature request for the kafka consumer health indicator if it seems to be useful.

@brianwyka
Copy link
Contributor Author

@graemerocher can we get this in the next Micronaut release?

@graemerocher graemerocher merged commit 0cf580d into micronaut-projects:master Mar 18, 2021
@brianwyka brianwyka deleted the consumer-assignment-info branch March 18, 2021 23:02
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.

None yet

2 participants