quarkiverse / quarkus-openapi-generator

OpenAPI Generator - REST Client Generator
Apache License 2.0
108 stars 68 forks source link

Extending SmallRye Fault Tolerance support #587

Open nullptr0000 opened 6 months ago

nullptr0000 commented 6 months ago

Currently the Fault Tolerance support is limited to only supporting the CircuitBreaker annotation. It would be useful if this support was extended to the other annotations such as Timeout, Retry and Fallback as support for only CircuitBreaker seems unnecessarily restrictive.

In theory the enable and configuration patterns for these annotations can follow the same as currently implemented to support CircuitBreaker.

The only slight complication would seem to be for the Fallback operation, where a fallback method stub needs to be generated; I'd assume this can mirror the 'normal' method name with a prefix or suffix attached, or the fallback method name could be fully specified in the configuration.

hbelmiro commented 6 months ago

Sounds good. Are you willing to send a PR? If so, I recommend one PR for each annotation.

nullptr0000 commented 6 months ago

I think looking at the structure of the project under 'deployment', the first step really needs to be to relocate/refactor the 'circuitbreaker' elements within both the project and the tests so they're under 'faulttolerance' (or whatever seems suitable) instead, otherwise the structure is going to end up a bit messy if was replicated as-is with a stack of circuitbreaker/retry/timeout/fallback side by side instead of them being bundled together.

Once that's done it should be a lot easier to incrementally add the extra annotations.

I guess whoever originally included it was more interested in just the circuit breaker part than in how the other parts of the fault tolerance specification might be included too.

hbelmiro commented 6 months ago

I agree. We can make this issue an epic and create one issue for each annotation and the initial refactoring. Can you do it @nullptr0000?