alibaba/Sentinel

Dashboard Spring Boot Configuration more flexible support

開放

#2,053 建立於 2021年2月27日

 (3 則留言) (0 個反應) (0 位負責人)Java (8,150 個分叉)batch import
area/dashboardgood first issuekind/enhancement

倉庫指標

星標
 (23,109 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Issue Description

Type: feature request

Describe what happened (or what feature you want)

Make dashboard more extensible.

Describe what you expected to happen

Spring Boot Configuration more flexible

Use @ConditionalOnMissingBean not @Component directly, combine with @Configuration to create a bean.

For example, about MachineDiscovery.

We can write code like follow

@Configuration
public class MachineDiscoveryConfiguration {

  @Bean
  @ConditionalOnMissingBean
  public SimpleMachineDiscovery simpleMachineDiscovery() {
    return new SimpleMachineDiscovery();
  }

  @Bean
  @ConditionalOnMissingBean
  public AppManagement appManagement(SimpleMachineDiscovery simpleMachineDiscovery) {
    return new AppManagement(simpleMachineDiscovery);
  }

}

And delete annotation @Component above class SimpleMachineDiscovery and AppManagement.

If someone want to custom their AppManagement, that will make it more easy.

Same principle can apply to RuleRepository, DynamicRuleProvider, DynamicRulePublisher too.

貢獻者指南