-
Notifications
You must be signed in to change notification settings - Fork 111
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
Remove ConsumerRebalanceListener
from ConsumerVerticleContext
#3207
Remove ConsumerRebalanceListener
from ConsumerVerticleContext
#3207
Conversation
Skipping CI for Draft Pull Request. |
Codecov Report
@@ Coverage Diff @@
## main #3207 +/- ##
============================================
- Coverage 63.42% 63.38% -0.05%
+ Complexity 752 746 -6
============================================
Files 167 167
Lines 11815 11815
Branches 246 246
============================================
- Hits 7494 7489 -5
+ Misses 3753 3752 -1
- Partials 568 574 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@pierDipi consumerVerticle.setRebalanceListener(createRebalanceListener(partitionRevokedHandlers)); In this approach, some tests are failing as the consumerVerticleListener is not getting initialised. protected ConsumerRebalanceListener getConsumerRebalanceListener() {
if(consumerRebalanceListener != null){
return consumerRebalanceListener;
}
return new ConsumerRebalanceListener() {
@Override
public void onPartitionsRevoked(final Collection<TopicPartition> partitions) {
getPartitionRevokedHandler().partitionRevoked(partitions).onComplete(
r -> logger.info("Partitions revoked {}", consumerVerticleContext.getLoggingKeyValue()));
}
@Override
public void onPartitionsAssigned(final Collection<TopicPartition> partitions) {
logger.info("Partitions assigned {}", consumerVerticleContext.getLoggingKeyValue());
}
};
} But I think it is like same as Building the ConsumerRebalanceListener inside it. |
I didn't get what's the problem, can you expand a bit more? |
I have moved the ConsumerRebalanceLitener creation Logic out from the ConsumerVerticle and use |
Oh wait I can put consumerVerticle.setRebalanceListener(new ConsumerRebalanceListener() {....}) into the tests. and leave the code logic the same as now. |
/retest |
@pierDipi would you take a look now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: debasishbsws, pierDipi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
c649ec4
into
knative-extensions:main
…ative-extensions#3207) * Implemented * Test fixed acording * Change the Tests to set RebalanceListener
A clean conflict-free PR of #3195
Proposed Changes
ConsumerRebalanceListener
intoConsumerVerticle