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

Access consumer from ConsumerRebalanceListener in Spring Kafka #304

Closed
arammkrtchyan opened this issue Apr 29, 2017 · 1 comment
Closed
Assignees
Labels
Milestone

Comments

@arammkrtchyan
Copy link

Hi guys,
Is it possible to make consumer rebalance listener registration to be consumer aware?
I need to have consumer in onPartitionsRevoked and onPartitionsAssigned functions for manual offset control.
Here is shortly want I wanted to do:

containerProperties.setConsumerRebalanceListener(new ConsumerRebalanceListener() {
            @Override
            public void onPartitionsRevoked(Collection<TopicPartition> partitions) {
                //
                store(consumer.position(partition));
            }

            @Override
            public void onPartitionsAssigned(Collection<TopicPartition> partitions) {
                //
                consumer.seek(partition, offsetTracker.getOffset() + 1);
            }
      });

This is the link of SO topic: http://stackoverflow.com/questions/43688144/access-consumer-from-consumerrebalancelistener-in-spring-kafka

Thanks.

@garyrussell garyrussell self-assigned this May 9, 2017
@garyrussell garyrussell added this to the 2.0 M2 milestone May 9, 2017
garyrussell added a commit to garyrussell/spring-kafka that referenced this issue May 9, 2017
Resolves: spring-projects#304

Allow user code to maintain offsets in some external store.
@arammkrtchyan
Copy link
Author

Thanks guys !!

denis554 added a commit to denis554/spring-kafka that referenced this issue Mar 27, 2019
Resolves: spring-projects/spring-kafka#304

Allow user code to maintain offsets in some external store.

* Simple polishing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants