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

feat(consumergroup): add consumer group commands #596

Merged
merged 5 commits into from
Apr 19, 2021

Conversation

craicoverflow
Copy link
Contributor

@craicoverflow craicoverflow commented Apr 19, 2021

Closes #384 #583 #537 #386

List

❯ ./rhoas kafka consumergroup list

  CONSUMER GROUP ID        ACTIVE MEMBERS   PARTITIONS WITH LAG  
 ------------------------ ---------------- --------------------- 
  console-consumer-86735                4                     1 

Describe

❯ ./rhoas kafka consumergroup describe --id console-consumer-86735

ACTIVE MEMBERS: 4        PARTITIONS WITH LAG: 1

  MEMBER ID (4)                                                            PARTITION   TOPIC     LOG END OFFSET   CURRENT OFFSET   OFFSET LAG  
 ------------------------------------------------------------------------ ----------- --------- ---------------- ---------------- ------------ 
  consumer-console-consumer-86735-1-809fe491-aeb3-4e04-a0b5-204f3a4a0da9           0   topic-3                0                0            0  
  consumer-console-consumer-86735-1-809fe491-aeb3-4e04-a0b5-204f3a4a0da9           1   topic-3                1                0            1  
  consumer-console-consumer-86735-1-809fe491-aeb3-4e04-a0b5-204f3a4a0da9           2   topic-3                0                0            0  
  consumer-console-consumer-86735-1-809fe491-aeb3-4e04-a0b5-204f3a4a0da9           3   topic-3                0                0            0  

Verification Steps

  1. Create a Kafka instance.
  2. Create a topic "topic-1" with 5 partitions.
  3. Produce messages with an external tool like the kafka bin scripts.
  4. Consume messages from it using the same tool.
  5. Run the rhoas kafka consumergroup {list|describe|delete} commands to exercise functionality.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation change
  • Other (please specify)

Checklist

  • Documentation added for the feature
  • CI and all relevant tests are passing
  • Code Review completed
  • Verified independently by reviewer

@craicoverflow craicoverflow changed the title fixes feat(consumergroup): add consumer group commands Apr 19, 2021
@craicoverflow
Copy link
Contributor Author

@rkpattnaik780 I have found from the Cobra docs that you can use dynamic completions for flags!! So I have reverted to use --id here.

https://github.com/spf13/cobra/blob/master/shell_completions.md#specify-dynamic-flag-completion

Copy link
Contributor

@rkpattnaik780 rkpattnaik780 left a comment

Choose a reason for hiding this comment

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

Great one!

@craicoverflow craicoverflow merged commit 54c578c into redhat-developer:main Apr 19, 2021
@craicoverflow craicoverflow deleted the consumer-groups branch April 19, 2021 15:28
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.

Add ability to list consumer groups for a Kafka instance
2 participants