diff --git a/spring-cloud-circuitbreaker.html b/spring-cloud-circuitbreaker.html index 28ea187..e25d6e3 100644 --- a/spring-cloud-circuitbreaker.html +++ b/spring-cloud-circuitbreaker.html @@ -103,6 +103,7 @@ $(addBlockSwitches);
  • Building @@ -150,6 +151,9 @@ breaker implementation that best fits your needs for your app.

  • Resilience4J

  • +
  • +

    Sentinel

    +
  • @@ -421,6 +425,60 @@ public Customizer<ReactiveResilience4JCircuitBreakerFactory> slowCusomtize +
    +

    Configuring Sentinel Circuit Breakers

    +
    +

    Default Configuration

    +
    +

    To provide a default configuration for all of your circuit breakers create a Customizer bean that is passed a +SentinelCircuitBreakerFactory. +The configureDefault method can be used to provide a default configuration.

    +
    +
    +
    +
    +
    +
    @Bean
    +public Customizer<SentinelCircuitBreakerFactory> defaultCustomizer() {
    +	return factory -> factory.configureDefault(id -> new SentinelConfigBuilder(id)
    +			.build());
    +}
    +
    +
    +
    +
    +
    +

    You can choose to provide default circuit breaking rules via SentinelConfigBuilder#rules(rules). +You can also choose to load circuit breaking rules later elsewhere using +DegradeRuleManager.loadRules(rules) API of Sentinel.

    +
    +
    +
    +

    Specific Circuit Breaker Configuration

    +
    +

    Similarly to providing a default configuration, you can create a Customizer bean this is passed a +SentinelCircuitBreakerFactory.

    +
    +
    +
    +
    +
    +
    @Bean
    +public Customizer<SentinelCircuitBreakerFactory> slowCustomizer() {
    +	String slowId = "slow";
    +	List<DegradeRule> rules = Collections.singletonList(
    +		new DegradeRule(slowId).setGrade(RuleConstant.DEGRADE_GRADE_RT)
    +			.setCount(100)
    +			.setTimeWindow(10)
    +		);
    +	return factory -> factory.configure(builder -> builder.rules(rules), slowId);
    +}
    +
    +
    +
    +
    +
    +