alibaba/Sentinel

Dashboard Spring Boot Configuration more flexible support

Open

#2,053 opened on 2021年2月27日

GitHub で見る
 (3 comments) (0 reactions) (0 assignees)Java (23,109 stars) (8,150 forks)batch import
area/dashboardgood first issuekind/enhancement

説明

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.

コントリビューターガイド

Dashboard Spring Boot Configuration more flexible support · alibaba/Sentinel#2053 | Good First Issue