Copilot commented on code in PR #776:
URL: 
https://github.com/apache/rocketmq-dashboard/pull/776#discussion_r3701474303


##########
server/src/main/java/org/apache/rocketmq/studio/cluster/broker/ClusterRepositoryImpl.java:
##########
@@ -40,8 +41,11 @@ public class ClusterRepositoryImpl implements 
ClusterRepository {
 
     private final Map<String, ClusterVO> store = new ConcurrentHashMap<>();
 
-    public ClusterRepositoryImpl() {
-        initStubData();
+    public 
ClusterRepositoryImpl(@Value("${studio.cluster.seed-demo-data:false}") boolean 
seedDemoData) {
+        if (seedDemoData) {
+            initStubData();
+            log.info("Initialized demo cluster data for Studio cluster 
repository");
+        }

Review Comment:
   This repository generally centralizes `studio.*` configuration in 
`@ConfigurationProperties` beans (e.g., `PrometheusProperties` at 
`studio.metrics.prometheus` and `MqAdminProperties` at `studio.cluster.admin`). 
Using `@Value` directly here introduces an inconsistent configuration pattern 
and makes it harder to discover/validate all Studio properties in one place.
   
   Consider introducing a small `@ConfigurationProperties(prefix = 
"studio.cluster")` bean with `seedDemoData` (default `false`) and 
constructor-inject that bean into the repository instead of `@Value`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to