James Netherton created CAMEL-20684:
---------------------------------------
Summary: 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
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 a 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)