You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "James Netherton (Jira)" <ji...@apache.org> on 2025/04/25 13:35:00 UTC

[jira] [Commented] (CAMEL-21857) camel-microprofile-fault-tolerance: Refactor component to avoid internal API usage

    [ https://issues.apache.org/jira/browse/CAMEL-21857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17947332#comment-17947332 ] 

James Netherton commented on CAMEL-21857:
-----------------------------------------

I took a quick look at this. I think we can use the SmallRye Fault Tolerance Programmatic APIs:

[https://smallrye.io/docs/smallrye-fault-tolerance/6.9.1/reference/programmatic-api.html]

It seems to mostly work fine using TypedGuard. The only issue is with fallback. Currently, you can only configure a handler once. We need things to be more dynamic to set the handler in FaultToleranceProcessor.process, as we need access to the incoming exchange.

I don't see any thread safe way of doing that, so we'll probably need to request an enhancement from SmallRye Fault Tolerance that allows you to set the fallback handler on-the-fly.

E.g something like:

guard.call(circuitBreakerTask).fallback(circuitBreakerFallbackTask)

> camel-microprofile-fault-tolerance: Refactor component to avoid internal API usage
> ----------------------------------------------------------------------------------
>
>                 Key: CAMEL-21857
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21857
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-microprofile-fault-tolerance
>    Affects Versions: 4.x
>            Reporter: James Netherton
>            Priority: Minor
>             Fix For: 4.x
>
>
> The camel-microprofile-fault-tolerance component is using a lot of internal APIs from SmallRye Fault Tolerance. We should try to refactor the component to avoid this, otherwise we are exposed to breakages if we want to upgrade to newer SmallRye Fault Tolerance releases.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)