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

[WIP] pasue and resume consumer #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JackMF
Copy link

@JackMF JackMF commented Aug 11, 2021

urning the consumer into gen_statem with polling and paused state. TODO update consumer_group and manager to hande calls.

…ODO update consumer_group and manager to hande calls
@JackMF JackMF changed the title pasue and resume consumer [WIP] pasue and resume consumer Aug 11, 2021
@silviucpp
Copy link
Owner

I honestly believe this approach is wrong. Better is to use the librdkafka api for pausing/resuming consumers. Just to give you an example with the implementation you did in case a rebalancing takes place the existing instance of erlkaf_consumer is destroyed and another one is created when re-assignment is completed. Your state will gone in this case.

If you use the librdkafka api this use case will be covered. confluentinc/librdkafka#1849

@silviucpp
Copy link
Owner

@JackMF
Copy link
Author

JackMF commented Aug 11, 2021

I understand that the partition would not be paused after a rebalance. However, the use case I was imagining would not want it to remain paused after a rebalance. Perhaps I should implement this at application level as you say. I just wanted the neatness of being able to call erlkaf:pause_conusmer(Topic, Partition) .

A quick question if I called, erkaf_consumer:stop(Pid), just for one partition of a topic - would this trigger a rebalance? Or would this have a similar effect as this "pasue" I am imagining above. If so could I create an expose a erlkaf:stop_consumer(Topic, Partition) which would call erkaf_consumer:stop(Pid) behind the scenes?

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