-
Notifications
You must be signed in to change notification settings - Fork 114
[admin-tool] Refactor DumpAdminMessages to log messages as they are received #2402
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
base: main
Are you sure you want to change the base?
Conversation
- Changed dumpAdminMessages() to log messages immediately instead of buffering - Added Logger similar to KafkaTopicDumper pattern - Changed return type from List<AdminOperationInfo> to int (count) - Removed unused AdminOperationInfo inner class - Moved getPubSubConsumerProperties to AdminTool, then replaced with PubSubUtil.addPubSubBrokerAddress - Updated AdminTool.dumpAdminMessages() to use try-with-resources - Updated tests to work with new return type
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.
Pull request overview
This PR refactors the DumpAdminMessages utility to log admin messages as they are received instead of buffering them in memory. The changes improve resource management and follow existing patterns in the codebase.
Changes:
- Replaced buffering with immediate logging of admin messages using Log4j logger
- Added try-with-resources for proper consumer cleanup
- Consolidated SSL validation logic by replacing
getPubSubConsumerPropertieswith existing utilities
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| DumpAdminMessages.java | Removed AdminOperationInfo inner class, changed return type to int, added logger for immediate message output, removed redundant getPubSubConsumerProperties method |
| AdminTool.java | Added try-with-resources for consumer management, replaced custom method with PubSubUtil.addPubSubBrokerAddress |
| TestAdminToolConsumption.java | Updated test to verify integer count instead of list size |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Update ProducerMd logging to use expanded format matching KafkaTopicDumper:
ProducerMd:(guid:{},seg:{},seq:{},mts:{},lts:{}) instead of toString()
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.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
[admin-tool] Refactor DumpAdminMessages to log messages as they are received
Code changes
Concurrency-Specific Checks
Both reviewer and PR author to verify
synchronized,RWLock) are used where needed.ConcurrentHashMap,CopyOnWriteArrayList).How was this PR tested?
Does this PR introduce any user-facing or breaking changes?