resilience4j / resilience4j-spring-boot2-demo

A Spring Boot 2 demo which shows how to use the Resilience4j Spring Boot 2 Starter
Apache License 2.0
253 stars 189 forks source link

Description of the options found in YML properties as documentation #46

Open patpatpat123 opened 4 years ago

patpatpat123 commented 4 years ago

Hello Resilience4j,

First of all, a big thanks for this demo project. Having the ability to just run and see resilience4j in action really helps build confidence and interest in the whole fault-tolerant architecture.

I just have a small request for enhancement, if possible, and hope not to trouble. Would it be possible to have a documentation listing the options and configurations please?

Currently, in the doc, we can find something such as:

resilience4j.circuitbreaker:
    instances:
        backendA:
            registerHealthIndicator: true
            slidingWindowSize: 100
        backendB:
            registerHealthIndicator: true
            slidingWindowSize: 10
            permittedNumberOfCallsInHalfOpenState: 3
            slidingWindowType: TIME_BASED
            minimumNumberOfCalls: 20
            waitDurationInOpenState: 50s
            failureRateThreshold: 50
            eventConsumerBufferSize: 10
            recordFailurePredicate: io.github.robwin.exception.RecordFailurePredicate

Agree, some of the properties/configurations are very straightforward. However, some are not, and having to tune the values on trial and error might not be the best approach.

Some documentation pages, like those found in other Spring Boot projects can help understand this in a friendly way. Some human readable explanations can definitely bring more values.

Many thanks

RobWin commented 4 years ago

Have you already had a look at his page? https://resilience4j.readme.io/

and

https://resilience4j.readme.io/docs/circuitbreaker

patpatpat123 commented 4 years ago

Of course, many many times. And they are well written, no doubt.

My post was more of a request to get something more like this: (and this is just an example, Spring Security or Spring Boot have even better details on what the key means, and how to configure the value associated to the key. https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#production-ready-endpoints-enabling-endpoints

Where we can see

Screen Shot 2020-10-24 at 6 32 09 PM

Since the tunning of the values of circuit breaker, as well as sometimes the combinations of properties plays a major role in the efficiency of all the patterns, I think it might be a good addition to have something that really details. Something like:

resilience4j.retry.configs.default.retryExceptions=org.springframework.web.client.HttpServerErrorException
Used in combination with resilience4j.retry.configs.default.maxAttempts, @Retry will retry the annotated method the number of time configured in maxAttempts when the execution of the method encounter the exception found in HttpServerErrorException

(Again, I use this as an example, this one can be straightforward, but some under @CircuitBreaker are less straightforward)

But gain, it is just a request, no doubt the current docs are very good. If you believe this enhancement is not needed, or the current docs are clear enough, or the properties does not need additional information, please just feel free to close this, no big deal.

RobWin commented 4 years ago

Sure every enhancement is welcome. The documentation is community-driven. Every page has an "Suggest Edit" button. Please contribute any documentation which might be helpful for others as well.