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 2024/04/17 11:44:00 UTC

[jira] [Resolved] (CAMEL-20684) camel-microprofile-fault-tolerance: ThreadTimer should be a singleton

     [ https://issues.apache.org/jira/browse/CAMEL-20684?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Netherton resolved CAMEL-20684.
-------------------------------------
    Resolution: Fixed

> camel-microprofile-fault-tolerance: ThreadTimer should be a singleton
> ---------------------------------------------------------------------
>
>                 Key: CAMEL-20684
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20684
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-microprofile-fault-tolerance
>            Reporter: James Netherton
>            Assignee: James Netherton
>            Priority: Minor
>             Fix For: 4.6.0
>
>
> Something I missed when upgrading SmallRye Fault Tolerance to 6.3.0 is that the use of ThreadTimer requires it to be a singleton. You can't create multiple instances with a custom executor on each init of FaultToleranceProcessor.
> [https://github.com/smallrye/smallrye-fault-tolerance/blob/3d92e94269619115062a55f145b6b07eda18452f/implementation/core/src/main/java/io/smallrye/faulttolerance/core/timer/ThreadTimer.java#L67]
> For Quarkus, there's already a singleton scoped CDI bean containing the ThreadTimer, so we could wire that into the Camel registry and look it up later.
> Not sure how best to manage it for non-quarkus apps. You'd need to manage the lifecycle of the ThreadTimer & executor on Camel startup / shutdown.



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