rocketmq-rust
rocketmq-rust copied to clipboard
[Refactor♻️] Rename ConsumerBackend to ConsumerAndProducerAdmin in the native dashboard
Target Code
Start in rocketmq-dashboard/rocketmq-dashboard-gpui/. The affected files are listed below.
- Rename the trait, its implementation for
RealConsumerBackend, and the injection parameter inwith_consumer_backend.src/services/consumers.rs - Update the type of the
AppServices::consumersfield.src/services.rs - Update the import and the implementation for
FakeConsumerBackend.src/services/consumers_test_support.rs
Problems
The native dashboard routes producer_inventory and producer_connections through ConsumerBackend. The same trait also reads consumer group state and applies consumer group changes. A contributor looking for the producer admin interface can easily miss it.
Proposed Changes
- [ ] Rename the crate-private trait to
ConsumerAndProducerAdminwherever it is referenced. Keep this as one trait. - [ ] Keep the method names, concrete backend names, and
AppServicesentry points. Consumer group mutations and both producer queries should still call the existing implementations.
Run from rocketmq-dashboard/rocketmq-dashboard-gpui.
cargo fmt --all -- --check
cargo test --bin rocketmq-dashboard-gpui consumer_mutations_reload_complete_group_catalog_without_hiding_partial_diagnostics
cargo test --bin rocketmq-dashboard-gpui producer_manual_fallback_validates_the_pair_and_drops_a_late_previous_query
I'd like to take this issue. I'll rename the crate-private trait to ConsumerAndProducerAdmin, update its references, and run the two focused tests listed above while preserving the existing concrete backend names and behavior.