spring-cloud / spring-cloud-circuitbreaker

Spring Cloud Circuit Breaker API and Implementations
Apache License 2.0
329 stars 110 forks source link

addCircuitBreakerCustomizer register events in each time when method called #89

Closed Ferioney closed 1 year ago

Ferioney commented 3 years ago

When you use Resilience4JCircuitBreakerFactory.addCircuitBreakerCustomizer() to customize an event, this event will be added in every call of the method.

We customize circuitBreaker each time when calling a method. But circuitBreaker is stored in circuitBreakerRegistry. so each time we add an event to this circuitBreaker.

In Resilience4j events store as map, that why it possible: EventProcessor

Unit test that shows defect: defectTwoSlowCircuitBreakerConsumerShouldBeCalledTwoTimesButCalledThreeTimes

ryanjbaxter commented 3 years ago

If we don't call the create method when normal is called I think that would solve the problem no?

ryanjbaxter commented 3 years ago

https://github.com/Ferioney/spring-cloud-circuitbreaker/blob/defect_addCircuitBreakerCustomizer/spring-cloud-circuitbreaker-resilience4j/src/test/java/org/springframework/cloud/circuitbreaker/resilience4j/Resilience4JCircuitBreakerIntegrationTest.java#L198

spring-cloud-issues commented 3 years ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-cloud-issues commented 3 years ago

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

limng06 commented 2 years ago

it happened . the circuitbreaker always customize itselef in the “run” method and the event consumer will be added again

ryanjbaxter commented 2 years ago

@Ferioney @limng06 can you confirm if this is still a problem with the latest release Spring Cloud 2021.0.0?

spring-cloud-issues commented 2 years ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-cloud-issues commented 2 years ago

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.