diff --git a/bom/application/pom.xml b/bom/application/pom.xml index b141ced93db95..ef140be4aa6c1 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -46,7 +46,7 @@ 2.1.22 1.6.0 2.1.0 - 5.4.1 + 5.5.0 3.5.2 1.2.2 1.0.13 diff --git a/docs/src/main/asciidoc/smallrye-fault-tolerance.adoc b/docs/src/main/asciidoc/smallrye-fault-tolerance.adoc index 7e18935b0faf5..8e99e2aa0ad14 100644 --- a/docs/src/main/asciidoc/smallrye-fault-tolerance.adoc +++ b/docs/src/main/asciidoc/smallrye-fault-tolerance.adoc @@ -9,7 +9,7 @@ include::./attributes.adoc[] One of the challenges brought by the distributed nature of microservices is that communication with external systems is inherently unreliable. This increases demand on resiliency of applications. To simplify making more resilient -applications, Quarkus provides https://github.com/smallrye/smallrye-fault-tolerance/[SmallRye Fault Tolerance] an +applications, Quarkus provides https://github.com/smallrye/smallrye-fault-tolerance/[SmallRye Fault Tolerance], an implementation of the https://github.com/eclipse/microprofile-fault-tolerance/[MicroProfile Fault Tolerance] specification. @@ -500,7 +500,7 @@ implementation("io.quarkus:quarkus-smallrye-fault-tolerance") == Additional resources SmallRye Fault Tolerance has more features than shown here. -Please check the link:https://smallrye.io/docs/smallrye-fault-tolerance/5.4.0/index.html[SmallRye Fault Tolerance documentation] to learn about them. +Please check the link:https://smallrye.io/docs/smallrye-fault-tolerance/5.5.0/index.html[SmallRye Fault Tolerance documentation] to learn about them. In Quarkus, you can use the SmallRye Fault Tolerance optional features out of the box. @@ -532,7 +532,12 @@ smallrye.faulttolerance.mp-compatibility=true ---- ==== -The link:https://smallrye.io/docs/smallrye-fault-tolerance/5.4.0/usage/programmatic-api.html[programmatic API] is present, including Mutiny support, and integrated with the declarative, annotation-based API. +The link:https://smallrye.io/docs/smallrye-fault-tolerance/5.5.0/usage/programmatic-api.html[programmatic API] is present, including Mutiny support, and integrated with the declarative, annotation-based API. You can use the `FaultTolerance` and `MutinyFaultTolerance` APIs out of the box. Support for Kotlin is present (assuming you use the Quarkus extension for Kotlin), so you can guard your `suspend` functions with fault tolerance annotations. + +Metrics are automatically discovered and integrated. +If your application uses the Quarkus extension for Micrometer, SmallRye Fault Tolerance will emit metrics to Micrometer. +If your application uses the Quarkus extension for SmallRye Metrics, SmallRye Fault Tolerance will emit metrics to MicroProfile Metrics. +Otherwise, SmallRye Fault Tolerance metrics will be disabled. diff --git a/extensions/smallrye-fault-tolerance/deployment/src/main/java/io/quarkus/smallrye/faulttolerance/deployment/SmallRyeFaultToleranceProcessor.java b/extensions/smallrye-fault-tolerance/deployment/src/main/java/io/quarkus/smallrye/faulttolerance/deployment/SmallRyeFaultToleranceProcessor.java index c6b20949ef6ba..5b966fa61faaf 100644 --- a/extensions/smallrye-fault-tolerance/deployment/src/main/java/io/quarkus/smallrye/faulttolerance/deployment/SmallRyeFaultToleranceProcessor.java +++ b/extensions/smallrye-fault-tolerance/deployment/src/main/java/io/quarkus/smallrye/faulttolerance/deployment/SmallRyeFaultToleranceProcessor.java @@ -56,6 +56,7 @@ import io.quarkus.deployment.metrics.MetricsCapabilityBuildItem; import io.quarkus.deployment.recording.RecorderContext; import io.quarkus.gizmo.ClassOutput; +import io.quarkus.runtime.metrics.MetricsFactory; import io.quarkus.smallrye.faulttolerance.runtime.QuarkusAsyncExecutorProvider; import io.quarkus.smallrye.faulttolerance.runtime.QuarkusExistingCircuitBreakerNames; import io.quarkus.smallrye.faulttolerance.runtime.QuarkusFallbackHandlerProvider; @@ -72,7 +73,6 @@ import io.smallrye.faulttolerance.core.util.RunnableWrapper; import io.smallrye.faulttolerance.internal.RequestContextControllerProvider; import io.smallrye.faulttolerance.internal.StrategyCache; -import io.smallrye.faulttolerance.metrics.MetricsProvider; import io.smallrye.faulttolerance.propagation.ContextPropagationRequestContextControllerProvider; import io.smallrye.faulttolerance.propagation.ContextPropagationRunnableWrapper; @@ -190,10 +190,18 @@ public void transform(TransformationContext context) { StrategyCache.class, QuarkusFallbackHandlerProvider.class, QuarkusAsyncExecutorProvider.class, - MetricsProvider.class, CircuitBreakerMaintenanceImpl.class, RequestContextIntegration.class, SpecCompatibility.class); + + if (metricsCapability.isEmpty()) { + builder.addBeanClass("io.smallrye.faulttolerance.metrics.NoopProvider"); + } else if (metricsCapability.get().metricsSupported(MetricsFactory.MP_METRICS)) { + builder.addBeanClass("io.smallrye.faulttolerance.metrics.MicroProfileMetricsProvider"); + } else if (metricsCapability.get().metricsSupported(MetricsFactory.MICROMETER)) { + builder.addBeanClass("io.smallrye.faulttolerance.metrics.MicrometerProvider"); + } + beans.produce(builder.build()); // TODO FT should be smart enough and only initialize the stuff in the recorder if it's really needed @@ -205,11 +213,6 @@ public void transform(TransformationContext context) { CdiFaultToleranceSpi.LazyDependencies.class) .build()); - if (!metricsCapability.isPresent()) { - //disable fault tolerance metrics with the MP sys props - systemProperty.produce(new SystemPropertyBuildItem("MP_Fault_Tolerance_Metrics_Enabled", "false")); - } - config.produce(new RunTimeConfigurationDefaultBuildItem("smallrye.faulttolerance.mp-compatibility", "false")); } diff --git a/jakarta/rewrite.yml b/jakarta/rewrite.yml index 0671bf803a693..127f6609989cc 100644 --- a/jakarta/rewrite.yml +++ b/jakarta/rewrite.yml @@ -423,7 +423,7 @@ recipeList: newValue: 3.0.0-RC2 - org.openrewrite.maven.ChangePropertyValue: key: smallrye-fault-tolerance.version - newValue: 6.0.0-RC3 + newValue: 6.0.0-RC4 - org.openrewrite.maven.ChangePropertyValue: key: smallrye-graphql.version newValue: 2.0.0.RC4