Skip to content

Dashboard Spring Boot Configuration more flexible support #2053

@Anilople

Description

@Anilople

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/dashboardIssues or PRs about Sentinel Dashboardgood first issueGood for newcomerskind/enhancementCategory issues or prs related to enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions